aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/transactions_test.rb
diff options
context:
space:
mode:
authorNeeraj Singh <neerajdotname@gmail.com>2013-07-28 11:46:02 +0530
committerNeeraj Singh <neerajdotname@gmail.com>2013-07-28 11:46:02 +0530
commit09beb9c292da55158b9f966bf3ae0a583e2bfe7b (patch)
treefcee2c9cbe0ff37f8628ba067190173a527cc37d /activerecord/test/cases/transactions_test.rb
parentbffda1e65e41c77c6c7fc8053feee6dddd0900ef (diff)
downloadrails-09beb9c292da55158b9f966bf3ae0a583e2bfe7b.tar.gz
rails-09beb9c292da55158b9f966bf3ae0a583e2bfe7b.tar.bz2
rails-09beb9c292da55158b9f966bf3ae0a583e2bfe7b.zip
fix order dependent test
`ReflectionTest` uses column information in tests and those tests break if tests are run in random order.
Diffstat (limited to 'activerecord/test/cases/transactions_test.rb')
-rw-r--r--activerecord/test/cases/transactions_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/cases/transactions_test.rb b/activerecord/test/cases/transactions_test.rb
index 9c5f2e4724..f84088def3 100644
--- a/activerecord/test/cases/transactions_test.rb
+++ b/activerecord/test/cases/transactions_test.rb
@@ -453,6 +453,11 @@ class TransactionTest < ActiveRecord::TestCase
raise ActiveRecord::Rollback
end
end
+
+ ensure
+ Topic.reset_column_information # reset the column information to get correct reading
+ Topic.connection.remove_column('topics', 'stuff') if Topic.column_names.include?('stuff')
+ Topic.reset_column_information # reset the column information again for other tests
end
def test_transactions_state_from_rollback