aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2013-12-31 21:04:11 -0200
committerRafael Mendonça França <rafaelmfranca@gmail.com>2013-12-31 21:04:11 -0200
commit13c18fe2cab630798bd8f7946bc2646f0d295c7f (patch)
tree62dd235f59325497f636b445d7712ad0d5d64ccc
parentb953b2fc464a31dfd040de126030ac05e18f6e4c (diff)
downloadrails-13c18fe2cab630798bd8f7946bc2646f0d295c7f.tar.gz
rails-13c18fe2cab630798bd8f7946bc2646f0d295c7f.tar.bz2
rails-13c18fe2cab630798bd8f7946bc2646f0d295c7f.zip
Improve tests to use only public API
-rw-r--r--activerecord/test/cases/relation_test.rb5
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