diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2016-02-23 12:21:53 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2016-02-23 12:21:53 -0300 |
commit | 3b017856f72ac6711bfbbce2d6edd9c8b49923c1 (patch) | |
tree | 1fb57a2a7655791c984dcfb8fb8ade8f007240c2 | |
parent | 9cf5fa640602d9fbc971884864e7a061811d497d (diff) | |
download | rails-3b017856f72ac6711bfbbce2d6edd9c8b49923c1.tar.gz rails-3b017856f72ac6711bfbbce2d6edd9c8b49923c1.tar.bz2 rails-3b017856f72ac6711bfbbce2d6edd9c8b49923c1.zip |
Make sure we don't change the global state in the tests
We are creating the table but not deleting after the test.
-rw-r--r-- | activerecord/test/cases/migration_test.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb index 5a83748292..4ad0e59a05 100644 --- a/activerecord/test/cases/migration_test.rb +++ b/activerecord/test/cases/migration_test.rb @@ -587,6 +587,8 @@ class MigrationTest < ActiveRecord::TestCase if current_adapter?(:Mysql2Adapter, :PostgreSQLAdapter) def test_out_of_range_limit_should_raise + Person.connection.drop_table :test_integer_limits, if_exists: true + e = assert_raise(ActiveRecord::ActiveRecordError, "integer limit didn't raise") do Person.connection.create_table :test_integer_limits, :force => true do |t| t.column :bigone, :integer, :limit => 10 @@ -602,6 +604,8 @@ class MigrationTest < ActiveRecord::TestCase end end end + ensure + Person.connection.drop_table :test_integer_limits, if_exists: true end end |