Move test to the proper file

All preload tests are in the eager_test file
上级 a335e103
......@@ -1167,6 +1167,13 @@ def test_deep_including_through_habtm
)
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 }
......
......@@ -552,13 +552,6 @@ def test_find_with_preloaded_associations
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册