diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-05-26 23:50:49 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-05-26 23:50:49 -0300 |
commit | 5eae77c44b951f7e0083eedb3f9f4f1d7c3dec3d (patch) | |
tree | 34ccadcd64f9d5f251639cf147f9f7779b8df3ba /activerecord/test | |
parent | a335e10347e30b885d077cd9e638ee8840ed164a (diff) | |
download | rails-5eae77c44b951f7e0083eedb3f9f4f1d7c3dec3d.tar.gz rails-5eae77c44b951f7e0083eedb3f9f4f1d7c3dec3d.tar.bz2 rails-5eae77c44b951f7e0083eedb3f9f4f1d7c3dec3d.zip |
Move test to the proper file
All preload tests are in the eager_test file
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/associations/eager_test.rb | 7 | ||||
-rw-r--r-- | activerecord/test/cases/relations_test.rb | 7 |
2 files changed, 7 insertions, 7 deletions
diff --git a/activerecord/test/cases/associations/eager_test.rb b/activerecord/test/cases/associations/eager_test.rb index 8d7670aeb3..4e5d10118b 100644 --- a/activerecord/test/cases/associations/eager_test.rb +++ b/activerecord/test/cases/associations/eager_test.rb @@ -1167,6 +1167,13 @@ class EagerAssociationTest < ActiveRecord::TestCase ) end + test "deep preload" + post = Post.preload(author: :posts, comments: :post).first + + assert_predicate post.author.association(:posts), :loaded? + assert_predicate post.comments.first.association(:post), :loaded? + end + test "preloading does not cache has many association subset when preloaded with a through association" do author = Author.includes(:comments_with_order_and_conditions, :posts).first assert_no_queries { assert_equal 2, author.comments_with_order_and_conditions.size } diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb index 61111b254a..88df997a2f 100644 --- a/activerecord/test/cases/relations_test.rb +++ b/activerecord/test/cases/relations_test.rb @@ -552,13 +552,6 @@ class RelationTest < ActiveRecord::TestCase end end - def test_deep_preload - post = Post.preload(author: :posts, comments: :post).first - - assert_predicate post.author.association(:posts), :loaded? - assert_predicate post.comments.first.association(:post), :loaded? - end - def test_preload_applies_to_all_chained_preloaded_scopes assert_queries(3) do post = Post.with_comments.with_tags.first |