diff options
author | Neeraj Singh <neerajdotname@gmail.com> | 2013-07-28 11:46:02 +0530 |
---|---|---|
committer | Neeraj Singh <neerajdotname@gmail.com> | 2013-07-28 11:46:02 +0530 |
commit | 09beb9c292da55158b9f966bf3ae0a583e2bfe7b (patch) | |
tree | fcee2c9cbe0ff37f8628ba067190173a527cc37d | |
parent | bffda1e65e41c77c6c7fc8053feee6dddd0900ef (diff) | |
download | rails-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.
-rw-r--r-- | activerecord/test/cases/transactions_test.rb | 5 |
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 |