mirror of
https://github.com/discourse/discourse.git
synced 2025-01-31 16:14:16 +08:00
Ensure that we disconnect connection in test.
This commit is contained in:
parent
fffb7561c4
commit
b1375ef44e
|
@ -41,8 +41,14 @@ describe ActiveRecord::ConnectionHandling do
|
|||
|
||||
describe "#postgresql_fallback_connection" do
|
||||
it 'should return a PostgreSQL adapter' do
|
||||
expect(ActiveRecord::Base.postgresql_fallback_connection(config))
|
||||
.to be_an_instance_of(ActiveRecord::ConnectionAdapters::PostgreSQLAdapter)
|
||||
begin
|
||||
connection = ActiveRecord::Base.postgresql_fallback_connection(config)
|
||||
|
||||
expect(connection)
|
||||
.to be_an_instance_of(ActiveRecord::ConnectionAdapters::PostgreSQLAdapter)
|
||||
ensure
|
||||
connection.disconnect!
|
||||
end
|
||||
end
|
||||
|
||||
context 'when master server is down' do
|
||||
|
|
Loading…
Reference in New Issue
Block a user