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:
commit
18590e2809
1 changed files with 2 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue