1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Make sure we don't change the global state in the tests

We are creating the table but not deleting after the test.
This commit is contained in:
Rafael Mendonça França 2016-02-23 12:21:53 -03:00
parent 9cf5fa6406
commit 3b017856f7

View file

@ -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