diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2019-01-14 22:19:58 -0500 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2019-01-17 16:08:33 -0500 |
commit | 91ddb30083430622188d76eb9f29b78131df67f9 (patch) | |
tree | a92895bf9c2f5e3b344e095e68f448b370af6248 /activerecord/test | |
parent | 67356f2034ab41305af7218f7c8b2fee2d614129 (diff) | |
download | rails-91ddb30083430622188d76eb9f29b78131df67f9.tar.gz rails-91ddb30083430622188d76eb9f29b78131df67f9.tar.bz2 rails-91ddb30083430622188d76eb9f29b78131df67f9.zip |
Do not allow passing the column name to `sum` when a block is passed
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/calculations_test.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/test/cases/calculations_test.rb b/activerecord/test/cases/calculations_test.rb index 5075fed114..7af26d8ff5 100644 --- a/activerecord/test/cases/calculations_test.rb +++ b/activerecord/test/cases/calculations_test.rb @@ -923,9 +923,9 @@ class CalculationsTest < ActiveRecord::TestCase end end - def test_deprecate_sum_with_block_and_column_name - assert_deprecated do - assert_equal 6, Account.sum(:firm_id) { 1 } + def test_sum_with_block_and_column_name_raises_an_error + assert_raises(ArgumentError) do + Account.sum(:firm_id) { 1 } end end |