Skip to content

Commit

Permalink
Improved references test [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Feb 20, 2021
1 parent 3a7db45 commit 4071b20
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/median_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,13 @@ def test_association
end

def test_references
skip if mongoid?

user = User.create!
user.posts.create!(comments_count: 1)
# see https://github.com/ankane/active_median/issues/9
# use left_outer_joins(:posts) instead
assert_equal 1, User.includes(:posts).references(:posts).average(:comments_count)
# assert_equal 1, User.includes(:posts).references(:posts).median(:comments_count)
end

Expand Down

0 comments on commit 4071b20

Please sign in to comment.