diff options
Diffstat (limited to 'activerecord/test/cases/transactions_test.rb')
-rw-r--r-- | activerecord/test/cases/transactions_test.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/test/cases/transactions_test.rb b/activerecord/test/cases/transactions_test.rb index 0c8b372e79..bcbc48b38a 100644 --- a/activerecord/test/cases/transactions_test.rb +++ b/activerecord/test/cases/transactions_test.rb @@ -117,21 +117,21 @@ class TransactionTest < ActiveRecord::TestCase assert !Topic.find(1).approved? end - def test_update_attributes_should_rollback_on_failure + def test_update_should_rollback_on_failure author = Author.find(1) posts_count = author.posts.size assert posts_count > 0 - status = author.update_attributes(:name => nil, :post_ids => []) + status = author.update(name: nil, post_ids: []) assert !status assert_equal posts_count, author.posts(true).size end - def test_update_attributes_should_rollback_on_failure! + def test_update_should_rollback_on_failure! author = Author.find(1) posts_count = author.posts.size assert posts_count > 0 assert_raise(ActiveRecord::RecordInvalid) do - author.update_attributes!(:name => nil, :post_ids => []) + author.update!(name: nil, post_ids: []) end assert_equal posts_count, author.posts(true).size end |