提交 fa4fb501 编写于 作者: R Rick Olson

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
上级 c42cd3c3
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册