Skip to content

Commit

Permalink
Merge pull request #38928 from jonathanhefner/fix-limit-count-test-no…
Browse files Browse the repository at this point in the history
…n-determinism

Fix random CI fail due to non-deterministic order
  • Loading branch information
kamipo committed Apr 12, 2020
2 parents 2998672 + 5b28e42 commit bfbf696
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions activerecord/test/cases/calculations_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,14 @@ def test_should_limit_calculation_with_offset
end

def test_limit_should_apply_before_count
accounts = Account.limit(4)
accounts = Account.order(:id).limit(4)

assert_equal 3, accounts.count(:firm_id)
assert_equal 3, accounts.select(:firm_id).count
end

def test_limit_should_apply_before_count_arel_attribute
accounts = Account.limit(4)
accounts = Account.order(:id).limit(4)

firm_id_attribute = Account.arel_table[:firm_id]
assert_equal 3, accounts.count(firm_id_attribute)
Expand Down

0 comments on commit bfbf696

Please sign in to comment.