aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2019-04-12 22:11:38 +0900
committerGitHub <noreply@github.com>2019-04-12 22:11:38 +0900
commitef0c5fe0d98ad1b1b27fe3d6d19ae62aed3e8aa1 (patch)
treecaa318332ff73980197425312d88a380000ce01e /activerecord/test/cases
parent186566c58a559452883ae9f7a2d837ebf40be1f4 (diff)
parentbcb0fb792735e1be08ccffb153654cfc886e5ff4 (diff)
downloadrails-ef0c5fe0d98ad1b1b27fe3d6d19ae62aed3e8aa1.tar.gz
rails-ef0c5fe0d98ad1b1b27fe3d6d19ae62aed3e8aa1.tar.bz2
rails-ef0c5fe0d98ad1b1b27fe3d6d19ae62aed3e8aa1.zip
Merge pull request #35918 from kamipo/lazy_sync_with_transaction_state_on_destroy
Lazy sync with transaction state on destroy
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/transactions_test.rb14
1 files changed, 8 insertions, 6 deletions
diff --git a/activerecord/test/cases/transactions_test.rb b/activerecord/test/cases/transactions_test.rb
index 410f07d3ab..d5a4f12376 100644
--- a/activerecord/test/cases/transactions_test.rb
+++ b/activerecord/test/cases/transactions_test.rb
@@ -26,13 +26,15 @@ class TransactionTest < ActiveRecord::TestCase
def test_raise_after_destroy
assert_not_predicate @first, :frozen?
- assert_raises(RuntimeError) {
- Topic.transaction do
- @first.destroy
- assert_predicate @first, :frozen?
- raise
+ assert_not_called(@first, :rolledback!) do
+ assert_raises(RuntimeError) do
+ Topic.transaction do
+ @first.destroy
+ assert_predicate @first, :frozen?
+ raise
+ end
end
- }
+ end
assert_not_predicate @first, :frozen?
end