Skip to content

Commit

Permalink
Added spec for editable attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
vsamaco committed Feb 6, 2014
1 parent b602b70 commit b20093a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions spec/schema_generator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,21 @@
Example.schema[:validations][:code].should have_key :presence
Example.schema[:validations][:code].should have_key :numericality
end

it 'includes editable attributes' do
Example.schema[:editable_attributes].size.should == 2
Example.schema[:editable_attributes].should include(:name, :code)
end

it 'excludes non-editable attributes' do
Example.schema[:editable_attributes].should_not include(:created_at)
end
end

class Example < Deja::Node
attribute :name, String
attribute :code, String
attribute :created_at, Time, :editable => false

validates :name, :presence => true
validates :code, :presence => true
Expand Down

0 comments on commit b20093a

Please sign in to comment.