diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2014-01-15 21:59:33 -0200 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2014-01-16 18:40:18 -0200 |
commit | 07ff3525d5275de47960c3a012a1fa261bbfdfc8 (patch) | |
tree | 43ad2d57e38ebcd4aa47b3c13e2c8b51e2462e68 /activerecord/test | |
parent | da4b5e8ecbfc684850e23afe2b3522d32e48bcac (diff) | |
download | rails-07ff3525d5275de47960c3a012a1fa261bbfdfc8.tar.gz rails-07ff3525d5275de47960c3a012a1fa261bbfdfc8.tar.bz2 rails-07ff3525d5275de47960c3a012a1fa261bbfdfc8.zip |
No need for instance vars on single tests
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/transaction_callbacks_test.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/activerecord/test/cases/transaction_callbacks_test.rb b/activerecord/test/cases/transaction_callbacks_test.rb index 256b043011..2da0754040 100644 --- a/activerecord/test/cases/transaction_callbacks_test.rb +++ b/activerecord/test/cases/transaction_callbacks_test.rb @@ -93,11 +93,11 @@ class TransactionCallbacksTest < ActiveRecord::TestCase end def test_only_call_after_commit_on_create_after_transaction_commits_for_new_record - @new_record = TopicWithCallbacks.new(:title => "New topic", :written_on => Date.today) - add_transaction_execution_blocks @new_record + new_record = TopicWithCallbacks.new(:title => "New topic", :written_on => Date.today) + add_transaction_execution_blocks new_record - @new_record.save! - assert_equal [:commit_on_create], @new_record.history + new_record.save! + assert_equal [:commit_on_create], new_record.history end def test_only_call_after_commit_on_create_after_transaction_commits_for_new_record_if_create_succeeds_creating_through_association @@ -160,15 +160,15 @@ class TransactionCallbacksTest < ActiveRecord::TestCase end def test_only_call_after_rollback_on_create_after_transaction_rollsback_for_new_record - @new_record = TopicWithCallbacks.new(:title => "New topic", :written_on => Date.today) - add_transaction_execution_blocks @new_record + new_record = TopicWithCallbacks.new(:title => "New topic", :written_on => Date.today) + add_transaction_execution_blocks new_record Topic.transaction do - @new_record.save! + new_record.save! raise ActiveRecord::Rollback end - assert_equal [:rollback_on_create], @new_record.history + assert_equal [:rollback_on_create], new_record.history end def test_call_after_rollback_when_commit_fails |