Skip to content

Commit

Permalink
reload the model being considered in the create specs ofr AR PickleOr…
Browse files Browse the repository at this point in the history
…mAdapter
  • Loading branch information
ianwhite committed Aug 26, 2010
1 parent 34a6235 commit 4d60b33
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions spec/pickle/orm_adapters/active_record_spec.rb
Expand Up @@ -137,7 +137,8 @@ class Note < AbstractNoteClass

it "should handle belongs_to objects in attributes hash" do
site = Site.create!
subject.create_model(User, :site => site).tap do |user|
subject.create_model(User, :site => site)
User.last.tap do |user|
user.should be_a(User)
user.site.should == site
user.should_not be_new_record
Expand All @@ -146,7 +147,8 @@ class Note < AbstractNoteClass

it "should handle polymorphic belongs_to objects in attributes hash" do
site = Site.create!
subject.create_model(Note, :owner => site).tap do |note|
subject.create_model(Note, :owner => site)
Note.last.tap do |note|
note.should be_a(Note)
note.owner.should == site
note.should_not be_new_record
Expand All @@ -155,7 +157,8 @@ class Note < AbstractNoteClass

it "should handle has_many objects in attributes hash" do
users = [User.create!, User.create!]
subject.create_model(Site, :users => users).tap do |site|
subject.create_model(Site, :users => users)
Site.last.tap do |site|
site.should be_a(Site)
site.users.should == users
site.should_not be_new_record
Expand Down

0 comments on commit 4d60b33

Please sign in to comment.