From 13c18fe2cab630798bd8f7946bc2646f0d295c7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Tue, 31 Dec 2013 21:04:11 -0200 Subject: Improve tests to use only public API --- activerecord/test/cases/relation_test.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'activerecord') diff --git a/activerecord/test/cases/relation_test.rb b/activerecord/test/cases/relation_test.rb index c4e7ba78c1..15611656fd 100644 --- a/activerecord/test/cases/relation_test.rb +++ b/activerecord/test/cases/relation_test.rb @@ -212,10 +212,9 @@ module ActiveRecord 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 -- cgit v1.2.3