diff options
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/transactions_test.rb | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/activerecord/test/cases/transactions_test.rb b/activerecord/test/cases/transactions_test.rb index bb5548a60f..7f2e830083 100644 --- a/activerecord/test/cases/transactions_test.rb +++ b/activerecord/test/cases/transactions_test.rb @@ -274,7 +274,7 @@ class TransactionTest < ActiveRecord::TestCase end end - def test_dirty_state_rollback + def test_rollback_when_changing_inside_transaction assert !@first.approved? Topic.transaction do @first.approved = true @@ -287,7 +287,7 @@ class TransactionTest < ActiveRecord::TestCase assert @first.reload.approved end - def test_dirty_state_rollback2 + def test_rollback_when_changing_outside_transaction assert !@first.approved? @first.approved = true Topic.transaction do @@ -300,22 +300,7 @@ class TransactionTest < ActiveRecord::TestCase assert @first.reload.approved end - def test_dirty_state_rollback3 - assert !@first.approved? - @first.approved = true - @first.save! - Topic.transaction do - @first.approved = false - @first.save! - raise ActiveRecord::Rollback - end - assert !@first.approved - assert @first.changes["approved"] - @first.save! - assert !@first.reload.approved - end - - def test_dirty_state_rollback4 + def test_rollback_when_changing_back_to_prev_stage assert !@first.approved? Topic.transaction do @first.approved = true @@ -330,6 +315,7 @@ class TransactionTest < ActiveRecord::TestCase assert !@first.reload.approved end + def test_force_savepoint_in_nested_transaction Topic.transaction do @first.approved = true |