Skip to content

Commit

Permalink
fix calculation tests to get around inconsistent ordering of nils
Browse files Browse the repository at this point in the history
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3872 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
technoweenie committed Mar 15, 2006
1 parent c42cd3c commit fa4fb50
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions activerecord/test/calculations_test.rb
Expand Up @@ -39,13 +39,13 @@ def test_should_group_by_summed_field

def test_should_order_by_grouped_field
c = Account.sum(:credit_limit, :group => :firm_id, :order => "firm_id")
assert_equal [nil, 1, 2, 6], c.keys
assert_equal [1, 2, 6], c.keys.compact
end

def test_should_order_by_calculation
c = Account.sum(:credit_limit, :group => :firm_id, :order => "sum_credit_limit desc, firm_id")
assert_equal [105, 60, 50, 50], c.keys.collect { |k| c[k] }
assert_equal [6, 2, nil, 1], c.keys
assert_equal [6, 2, 1], c.keys.compact
end

def test_should_group_by_summed_field_having_condition
Expand Down

0 comments on commit fa4fb50

Please sign in to comment.