Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

No need to test against target anymore.

  • Loading branch information...
commit 15a03ca9b0b9a3582ca0f7695ed87557eedc95fb 1 parent 0b702ba
@miloops miloops authored
Showing with 8 additions and 8 deletions.
  1. +8 −8 activerecord/test/cases/identity_map_test.rb
View
16 activerecord/test/cases/identity_map_test.rb
@@ -105,15 +105,15 @@ def test_owner_object_is_associated_from_identity_map
assert_no_queries do
comment.post
end
- assert_same post, comment.post.target
+ assert_same post, comment.post
end
def test_associated_object_are_assigned_from_identity_map
post = Post.find(1)
post.comments.each do |comment|
- assert_same post, comment.post.target
- assert_equal post.object_id, comment.post.target.object_id
+ assert_same post, comment.post
+ assert_equal post.object_id, comment.post.object_id
end
end
@@ -176,7 +176,7 @@ def test_has_many_associations
pirate.reload
pirate.birds_attributes = [{ :id => posideons.id, :name => 'Grace OMalley' }]
- assert_equal 'Grace OMalley', pirate.birds.send(:load_target).find { |r| r.id == posideons.id }.name
+ assert_equal 'Grace OMalley', pirate.birds.send(:load).find { |r| r.id == posideons.id }.name
end
def test_changing_associations
@@ -267,20 +267,20 @@ def test_eager_loading_with_conditions_on_joined_table_preloads
posts = Post.find(:all, :select => 'distinct posts.*', :include => :author, :joins => [:comments], :conditions => "comments.body like 'Thank you%'", :order => 'posts.id')
assert_equal [posts(:welcome)], posts
assert_equal authors(:david), assert_no_queries { posts[0].author}
- assert_same posts.first.author.target, Author.first
+ assert_same posts.first.author, Author.first
posts = Post.find(:all, :select => 'distinct posts.*', :include => :author, :joins => [:comments], :conditions => "comments.body like 'Thank you%'", :order => 'posts.id')
assert_equal [posts(:welcome)], posts
assert_equal authors(:david), assert_no_queries { posts[0].author}
- assert_same posts.first.author.target, Author.first
+ assert_same posts.first.author, Author.first
posts = Post.find(:all, :include => :author, :joins => {:taggings => :tag}, :conditions => "tags.name = 'General'", :order => 'posts.id')
assert_equal posts(:welcome, :thinking), posts
- assert_same posts.first.author.target, Author.first
+ assert_same posts.first.author, Author.first
posts = Post.find(:all, :include => :author, :joins => {:taggings => {:tag => :taggings}}, :conditions => "taggings_tags.super_tag_id=2", :order => 'posts.id')
assert_equal posts(:welcome, :thinking), posts
- assert_same posts.first.author.target, Author.first
+ assert_same posts.first.author, Author.first
end
def test_eager_loading_with_conditions_on_string_joined_table_preloads
Please sign in to comment.
Something went wrong with that request. Please try again.