提交 1f235a69 编写于 作者: R Ryuta Kamizono

Don't drop internal metadata tables

Some tests expects that internal metadata tables exists, and we should
not use `create_table` in transactional tests, since DDL in MySQL causes
implicit commit.

https://travis-ci.org/rails/rails/jobs/515438937#L3829
上级 4ecca4cd
......@@ -50,7 +50,6 @@ def test_raises_an_error_when_called_with_protected_environment
protected_environments = ActiveRecord::Base.protected_environments
current_env = ActiveRecord::Base.connection.migration_context.current_environment
InternalMetadata.create_table
InternalMetadata[:environment] = current_env
assert_called_on_instance_of(
......@@ -77,7 +76,6 @@ def test_raises_an_error_when_called_with_protected_environment_which_name_is_a_
protected_environments = ActiveRecord::Base.protected_environments
current_env = ActiveRecord::Base.connection.migration_context.current_environment
InternalMetadata.create_table
InternalMetadata[:environment] = current_env
assert_called_on_instance_of(
......@@ -966,8 +964,8 @@ def setup
end
def teardown
SchemaMigration.drop_table
InternalMetadata.drop_table
SchemaMigration.delete_all
InternalMetadata.delete_all
ActiveRecord::Base.connection_handlers = { writing: ActiveRecord::Base.default_connection_handler }
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册