Browse files

fix calculation tests to get around inconsistent ordering of nils

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3872 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent c42cd3c commit fa4fb50186cb80e824ce1a6a91bde2c2870628de @technoweenie technoweenie committed Mar 15, 2006
Showing with 2 additions and 2 deletions.
  1. +2 −2 activerecord/test/calculations_test.rb
View
4 activerecord/test/calculations_test.rb
@@ -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

0 comments on commit fa4fb50

Please sign in to comment.