diff options
author | Raimonds Simanovskis <raimonds.simanovskis@gmail.com> | 2009-03-23 00:07:23 +0200 |
---|---|---|
committer | Raimonds Simanovskis <raimonds.simanovskis@gmail.com> | 2009-08-06 23:40:59 +0300 |
commit | a12358b3a5e69f41079595d5c92677b66ae6e642 (patch) | |
tree | 1458fdf312cf2a350f043bc4db917709f01e9456 /activerecord/test/cases | |
parent | d40e3ea936fe37f0dba696c611d49c700ffa3542 (diff) | |
download | rails-a12358b3a5e69f41079595d5c92677b66ae6e642.tar.gz rails-a12358b3a5e69f41079595d5c92677b66ae6e642.tar.bz2 rails-a12358b3a5e69f41079595d5c92677b66ae6e642.zip |
Oracle adapter returns numeric (not string) value after SUM
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/calculations_test.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/activerecord/test/cases/calculations_test.rb b/activerecord/test/cases/calculations_test.rb index 75f52dfa4a..24bc4f71ce 100644 --- a/activerecord/test/cases/calculations_test.rb +++ b/activerecord/test/cases/calculations_test.rb @@ -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 |