Skip to content

Commit

Permalink
Minor tweaks to identity map tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnunemaker committed Jan 29, 2010
1 parent eeec9ea commit f97b797
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions test/functional/test_identity_map.rb
Expand Up @@ -365,7 +365,7 @@ class ::Item
key :parent_id, ObjectId key :parent_id, ObjectId


belongs_to :parent, :class_name => 'Item' belongs_to :parent, :class_name => 'Item'
one :child, :class_name => 'Blog' one :blog, :class_name => 'Blog', :foreign_key => 'parent_id'
end end
Item.collection.remove Item.collection.remove


Expand Down Expand Up @@ -421,9 +421,15 @@ class ::BlogPost < ::Item
blog = Blog.create(:title => 'Jill') blog = Blog.create(:title => 'Jill')
assert_in_map(blog) assert_in_map(blog)


root = Item.create(:title => 'Root', :child => blog) root = Item.create(:title => 'Root', :blog => blog)
assert_in_map(root) assert_in_map(root)
root.child.should equal(blog) root.blog.should equal(blog)
end

should "work correctly with one proxy create" do
root = Item.create(:title => 'Root')
blog = root.blog.create(:title => 'Blog')
blog.parent.should equal(root)
end end
end end


Expand Down

0 comments on commit f97b797

Please sign in to comment.