Skip to content
Browse files

Adds a test that breaks IM when using #select

  • Loading branch information...
1 parent 1d753ab commit b29e868cc335e2a696c36b6d7ccdf199ed8abf70 @arturopie committed Mar 25, 2012
Showing with 6 additions and 12 deletions.
  1. +6 −12 activerecord/test/cases/identity_map_test.rb
View
18 activerecord/test/cases/identity_map_test.rb
@@ -404,18 +404,12 @@ def test_find_using_identity_map_respects_readonly
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)

0 comments on commit b29e868

Please sign in to comment.
Something went wrong with that request. Please try again.