提交 13c18fe2 编写于 作者: R Rafael Mendonça França

Improve tests to use only public API

上级 b953b2fc
......@@ -212,10 +212,9 @@ def test_relation_merging_with_joins_as_join_dependency_pick_proper_parent
comment = post.comments.create!(body: "hu")
3.times { comment.ratings.create! }
relation = Post.joins Associations::JoinDependency.new(Post, :comments, [])
relation = relation.joins Associations::JoinDependency.new(Comment, :ratings, [])
relation = Post.joins(:comments).merge Comment.joins(:ratings)
assert_equal 3, relation.pluck(:id).select { |id| id == post.id }.count
assert_equal 3, relation.where(id: post.id).pluck(:id).size
end
def test_respond_to_for_non_selected_element
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册