提交 0542e060 编写于 作者: R Ryuta Kamizono

All modern adapters returns a numeric value as the result of numeric calculation

上级 0aa86534
......@@ -589,11 +589,7 @@ def test_count_with_block
end
def test_should_sum_expression
if current_adapter?(:SQLite3Adapter, :Mysql2Adapter, :PostgreSQLAdapter, :OracleAdapter)
assert_equal 636, Account.sum("2 * credit_limit")
else
assert_equal 636, Account.sum("2 * credit_limit").to_i
end
assert_equal 636, Account.sum("2 * credit_limit")
end
def test_sum_expression_returns_zero_when_no_records_to_sum
......
......@@ -335,11 +335,7 @@ def test_cache_is_flat
def test_cache_does_not_wrap_results_in_arrays
Task.cache do
if current_adapter?(:SQLite3Adapter, :Mysql2Adapter, :PostgreSQLAdapter, :OracleAdapter)
assert_equal 2, Task.connection.select_value("SELECT count(*) AS count_all FROM tasks")
else
assert_instance_of String, Task.connection.select_value("SELECT count(*) AS count_all FROM tasks")
end
assert_equal 2, Task.connection.select_value("SELECT count(*) AS count_all FROM tasks")
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册