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
This commit is contained in:
parent
c42cd3c383
commit
fa4fb50186
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user