diff options
Diffstat (limited to 'activerecord/test/cases/transaction_callbacks_test.rb')
-rw-r--r-- | activerecord/test/cases/transaction_callbacks_test.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/activerecord/test/cases/transaction_callbacks_test.rb b/activerecord/test/cases/transaction_callbacks_test.rb index cc146f5574..85f222bca2 100644 --- a/activerecord/test/cases/transaction_callbacks_test.rb +++ b/activerecord/test/cases/transaction_callbacks_test.rb @@ -260,22 +260,26 @@ class TransactionObserverCallbacksTest < ActiveRecord::TestCase class TopicWithObserverAttachedObserver < ActiveRecord::Observer def after_commit(record) - record.history.push :"TopicWithObserverAttachedObserver#after_commit" + record.history.push "after_commit" end def after_rollback(record) - record.history.push :"TopicWithObserverAttachedObserver#after_rollback" + record.history.push "after_rollback" end end def test_after_commit_called + assert TopicWithObserverAttachedObserver.instance, 'should have observer' + topic = TopicWithObserverAttached.new topic.save! - assert_equal topic.history, [:"TopicWithObserverAttachedObserver#after_commit"] + assert_equal %w{ after_commit }, topic.history end def test_after_rollback_called + assert TopicWithObserverAttachedObserver.instance, 'should have observer' + topic = TopicWithObserverAttached.new Topic.transaction do @@ -283,6 +287,6 @@ class TransactionObserverCallbacksTest < ActiveRecord::TestCase raise ActiveRecord::Rollback end - assert_equal topic.history, [:"TopicWithObserverObserver#after_rollback"] + assert_equal %w{ after_rollback }, topic.history end end |