提交 083d6f26 编写于 作者: J Jon Leighton

Update new tests in cascaded_eager_loading_test.rb to work with the modified...

Update new tests in cascaded_eager_loading_test.rb to work with the modified fixtures in this branch
上级 026dbd28
......@@ -51,24 +51,24 @@ def test_cascaded_eager_association_loading_with_join_for_count
categories = Category.joins(:categorizations).includes([{:posts=>:comments}, :authors])
assert_nothing_raised do
assert_equal 2, categories.count
assert_equal 2, categories.all.uniq.size # Must uniq since instantiating with inner joins will get dupes
assert_equal 3, categories.count
assert_equal 3, categories.all.uniq.size # Must uniq since instantiating with inner joins will get dupes
end
end
def test_cascaded_eager_association_loading_with_duplicated_includes
categories = Category.includes(:categorizations).includes(:categorizations => :author).where("categorizations.id is not null")
assert_nothing_raised do
assert_equal 2, categories.count
assert_equal 2, categories.all.size
assert_equal 3, categories.count
assert_equal 3, categories.all.size
end
end
def test_cascaded_eager_association_loading_with_twice_includes_edge_cases
categories = Category.includes(:categorizations => :author).includes(:categorizations => :post).where("posts.id is not null")
assert_nothing_raised do
assert_equal 2, categories.count
assert_equal 2, categories.all.size
assert_equal 3, categories.count
assert_equal 3, categories.all.size
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册