diff options
author | Marcin Raczkowski <marcin.raczkowski@gmail.com> | 2010-08-28 18:47:39 +0200 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2010-11-19 19:03:56 -0300 |
commit | ce3ea558ab509624a1c8d8499408f52ebb4bbe2b (patch) | |
tree | 62d7bdf583f11f0932a7dd15ac10216446d2bf00 /activerecord/test/cases/relations_test.rb | |
parent | 3df4460a742c18af8cc71e41009c9028467d16b5 (diff) | |
download | rails-ce3ea558ab509624a1c8d8499408f52ebb4bbe2b.tar.gz rails-ce3ea558ab509624a1c8d8499408f52ebb4bbe2b.tar.bz2 rails-ce3ea558ab509624a1c8d8499408f52ebb4bbe2b.zip |
IdentityMap - Tests for IM
Diffstat (limited to 'activerecord/test/cases/relations_test.rb')
-rw-r--r-- | activerecord/test/cases/relations_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb index 535bcd4396..eb268017f8 100644 --- a/activerecord/test/cases/relations_test.rb +++ b/activerecord/test/cases/relations_test.rb @@ -263,6 +263,7 @@ class RelationTest < ActiveRecord::TestCase end def test_find_with_preloaded_associations + ActiveRecord::IdentityMap.without do assert_queries(2) do posts = Post.preload(:comments) assert posts.first.comments.first @@ -288,9 +289,11 @@ class RelationTest < ActiveRecord::TestCase assert posts.first.author assert posts.first.comments.first end + end end def test_find_with_included_associations + ActiveRecord::IdentityMap.without do assert_queries(2) do posts = Post.includes(:comments) assert posts.first.comments.first @@ -311,6 +314,7 @@ class RelationTest < ActiveRecord::TestCase assert posts.first.author assert posts.first.comments.first end + end end def test_default_scope_with_conditions_string @@ -552,9 +556,11 @@ class RelationTest < ActiveRecord::TestCase end def test_relation_merging_with_preload + ActiveRecord::IdentityMap.without do [Post.scoped & Post.preload(:author), Post.preload(:author) & Post.scoped].each do |posts| assert_queries(2) { assert posts.first.author } end + end end def test_relation_merging_with_joins |