From 714a2c810deb9d219442f7c981e61eb6d5c45d33 Mon Sep 17 00:00:00 2001 From: Arturo Pie Date: Mon, 26 Mar 2012 22:45:48 -0400 Subject: refactor the checking of the attributes of the record in IdentityMap#add, so it's more readable --- activerecord/test/cases/identity_map_test.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'activerecord/test') diff --git a/activerecord/test/cases/identity_map_test.rb b/activerecord/test/cases/identity_map_test.rb index 2a490126e2..63d0bcf1fc 100644 --- a/activerecord/test/cases/identity_map_test.rb +++ b/activerecord/test/cases/identity_map_test.rb @@ -404,11 +404,12 @@ class IdentityMapTest < ActiveRecord::TestCase assert comment.save end - def test_do_not_add_to_identity_map_if_record_do_not_contain_all_columns - post = Post.select(:id).first - comment = post.comments[0] + def test_do_not_add_to_repository_if_record_does_not_contain_all_columns + author = Author.select(:id).first + post = author.posts.first + assert_nothing_raised do - assert_not_nil comment.post.title + assert_not_nil post.author.name end end -- cgit v1.2.3