1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Oracle adapter returns numeric (not string) value after SUM

This commit is contained in:
Raimonds Simanovskis 2009-03-23 00:07:23 +02:00
parent d40e3ea936
commit a12358b3a5

View file

@ -298,7 +298,12 @@ class CalculationsTest < ActiveRecord::TestCase
end
def test_should_sum_expression
assert_equal '636', Account.sum("2 * credit_limit")
# Oracle adapter returns floating point value 636.0 after SUM
if current_adapter?(:OracleAdapter)
assert_equal 636, Account.sum("2 * credit_limit")
else
assert_equal '636', Account.sum("2 * credit_limit")
end
end
def test_count_with_from_option