mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
failing test for eager loading
cherry-picked from https://github.com/rails/rails/pull/33763
This commit is contained in:
parent
ddac80a951
commit
4429540995
1 changed files with 5 additions and 0 deletions
|
@ -165,6 +165,11 @@ class CascadedEagerLoadingTest < ActiveRecord::TestCase
|
|||
assert_no_queries { assert_nil post.author }
|
||||
end
|
||||
|
||||
def test_eager_association_loading_with_missing_first_record
|
||||
posts = Post.where(id: 3).preload(author: { comments: :post }).to_a
|
||||
assert_equal posts.size, 1
|
||||
end
|
||||
|
||||
def test_eager_association_loading_with_recursive_cascading_four_levels_has_many_through
|
||||
source = Vertex.all.merge!(includes: { sinks: { sinks: { sinks: :sinks } } }, order: "vertices.id").first
|
||||
assert_equal vertices(:vertex_4), assert_no_queries { source.sinks.first.sinks.first.sinks.first }
|
||||
|
|
Loading…
Reference in a new issue