Move test to the proper file
All preload tests are in the eager_test file
This commit is contained in:
parent
a335e10347
commit
5eae77c44b
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user