Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Improve tests to use only public API

  • Loading branch information...
commit 13c18fe2cab630798bd8f7946bc2646f0d295c7f 1 parent b953b2f
@rafaelfranca rafaelfranca authored
Showing with 2 additions and 3 deletions.
  1. +2 −3 activerecord/test/cases/relation_test.rb
View
5 activerecord/test/cases/relation_test.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.