aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2012-03-30 16:45:24 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2012-03-30 16:45:24 -0700
commit9894d1665380d36a05f6444ed6fd15be85daf880 (patch)
tree93cfc9fc6ccecd2ce826d7f3ebd5f0a35e43317b /activerecord/test/cases
parent69465d9f7cf1a2b58520a2382694e465cd7762de (diff)
parent6896cd451545679a6413939fc4eae68f3cc3ba8b (diff)
downloadrails-9894d1665380d36a05f6444ed6fd15be85daf880.tar.gz
rails-9894d1665380d36a05f6444ed6fd15be85daf880.tar.bz2
rails-9894d1665380d36a05f6444ed6fd15be85daf880.zip
Merge pull request #5662 from arturopie/3-2_fixing_IM_when_using_find_select
Fixing Identity Map when using find select in rails 3.2
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/identity_map_test.rb17
1 files changed, 6 insertions, 11 deletions
diff --git a/activerecord/test/cases/identity_map_test.rb b/activerecord/test/cases/identity_map_test.rb
index 24132c7617..63d0bcf1fc 100644
--- a/activerecord/test/cases/identity_map_test.rb
+++ b/activerecord/test/cases/identity_map_test.rb
@@ -404,18 +404,13 @@ 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
+ def test_do_not_add_to_repository_if_record_does_not_contain_all_columns
+ author = Author.select(:id).first
+ post = author.posts.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
+ assert_nothing_raised do
+ assert_not_nil post.author.name
+ end
end
# Currently AR is not allowing changing primary key (see Persistence#update)