Skip to content
This repository has been archived by the owner on Apr 29, 2023. It is now read-only.

Commit

Permalink
fixed test for handling nested attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
bnisbett committed Oct 10, 2011
1 parent 120dd53 commit 42b9c0a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions spec/lib/simple_eav_spec.rb
Expand Up @@ -69,12 +69,16 @@
end
end
describe "nested attributes" do
it "nests the attributes properly" do
it "updates the nested attributes properly" do
child = Child.create :name=>'Joe Jr.'
person = Person.create :child=>child
lambda{
person.update_attributes :child_attributes=>{:name=>'John Jr.'}
}.should change(person.child, :name).from('Joe Jr.').to('John Jr.')
person.child.name.should == 'Joe Jr.'

person.update_attributes :child_attributes=>{:name=>'John Jr.'}
person.child.name.should == 'John Jr.'
# lambda{
# person.update_attributes :child_attributes=>{:name=>'John Jr.'}
# }.should change(person.child, :name).from('Joe Jr.').to('John Jr.')
end
end
describe "serialization" do
Expand Down

0 comments on commit 42b9c0a

Please sign in to comment.