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:
parent
a335e10347
commit
5eae77c44b
2 changed files with 7 additions and 7 deletions
|
@ -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 }
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue