Skip to content

Commit 0fac455

Browse files
marlabrizelkamipo
andauthored
Update ActiveRecord::OrTest#test_or_when_grouping (rails#38978)
Co-authored-by: Ryuta Kamizono <[email protected]>
1 parent 2c03e17 commit 0fac455

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

activerecord/test/cases/relation/or_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ def test_or_with_incompatible_unscope
9595
end
9696

9797
def test_or_when_grouping
98-
groups = Post.where("id < 10").group("body").select("body, COUNT(*) AS c")
99-
expected = groups.having("COUNT(*) > 1 OR body like 'Such%'").to_a.map { |o| [o.body, o.c] }
100-
assert_equal expected, groups.having("COUNT(*) > 1").or(groups.having("body like 'Such%'")).to_a.map { |o| [o.body, o.c] }
98+
groups = Post.where("id < 10").group("body")
99+
expected = groups.having("COUNT(*) > 1 OR body like 'Such%'").count
100+
assert_equal expected, groups.having("COUNT(*) > 1").or(groups.having("body like 'Such%'")).count
101101
end
102102

103103
def test_or_with_named_scope

0 commit comments

Comments
 (0)