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

Merge pull request #29291 from y-yagi/make_sure_to_disable_extension_after_test

Make sure to disable extension after test
This commit is contained in:
Matthew Draper 2017-05-31 16:00:39 +09:30 committed by GitHub
commit 18590e2809

View file

@ -19,12 +19,7 @@ if ActiveRecord::Base.connection.supports_extensions?
def setup
@connection = ActiveRecord::Base.connection
unless @connection.extension_enabled?("hstore")
@connection.enable_extension "hstore"
@connection.commit_db_transaction
end
@connection.reconnect!
enable_extension!("hstore", @connection)
@connection.transaction do
@connection.create_table("hstores") do |t|
@ -40,6 +35,7 @@ if ActiveRecord::Base.connection.supports_extensions?
teardown do
@connection.drop_table "hstores", if_exists: true
disable_extension!("hstore", @connection)
end
def test_hstore_included_in_extensions