diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-12-31 21:04:11 -0200 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-12-31 21:04:11 -0200 |
commit | 13c18fe2cab630798bd8f7946bc2646f0d295c7f (patch) | |
tree | 62dd235f59325497f636b445d7712ad0d5d64ccc /activerecord | |
parent | b953b2fc464a31dfd040de126030ac05e18f6e4c (diff) | |
download | rails-13c18fe2cab630798bd8f7946bc2646f0d295c7f.tar.gz rails-13c18fe2cab630798bd8f7946bc2646f0d295c7f.tar.bz2 rails-13c18fe2cab630798bd8f7946bc2646f0d295c7f.zip |
Improve tests to use only public API
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/relation_test.rb | 5 |
1 files changed, 2 insertions, 3 deletions
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 |