1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Move test to the proper file

All preload tests are in the eager_test file
This commit is contained in:
Rafael Mendonça França 2014-05-26 23:50:49 -03:00
parent a335e10347
commit 5eae77c44b
2 changed files with 7 additions and 7 deletions

View file

@ -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 }

View file

@ -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