aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activerecord/test/cases/identity_map_test.rb18
1 files changed, 6 insertions, 12 deletions
diff --git a/activerecord/test/cases/identity_map_test.rb b/activerecord/test/cases/identity_map_test.rb
index 24132c7617..2a490126e2 100644
--- a/activerecord/test/cases/identity_map_test.rb
+++ b/activerecord/test/cases/identity_map_test.rb
@@ -404,18 +404,12 @@ class IdentityMapTest < ActiveRecord::TestCase
assert comment.save
end
- def test_find_using_select_and_identity_map
- author_id, author = Author.select('id').order(:id).first, Author.order(:id).first
-
- assert_equal author_id, author
- assert_same author_id, author
- assert_not_nil author.name
-
- post, post_id = Post.order(:id).first, Post.select('id').order(:id).first
-
- assert_equal post_id, post
- assert_same post_id, post
- assert_not_nil post.title
+ def test_do_not_add_to_identity_map_if_record_do_not_contain_all_columns
+ post = Post.select(:id).first
+ comment = post.comments[0]
+ assert_nothing_raised do
+ assert_not_nil comment.post.title
+ end
end
# Currently AR is not allowing changing primary key (see Persistence#update)