diff --git a/test/functional/test_identity_map.rb b/test/functional/test_identity_map.rb index 49632660b..3c47bfd0c 100644 --- a/test/functional/test_identity_map.rb +++ b/test/functional/test_identity_map.rb @@ -365,7 +365,7 @@ class ::Item key :parent_id, ObjectId belongs_to :parent, :class_name => 'Item' - one :child, :class_name => 'Blog' + one :blog, :class_name => 'Blog', :foreign_key => 'parent_id' end Item.collection.remove @@ -421,9 +421,15 @@ class ::BlogPost < ::Item blog = Blog.create(:title => 'Jill') assert_in_map(blog) - root = Item.create(:title => 'Root', :child => blog) + root = Item.create(:title => 'Root', :blog => blog) 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