mirror of
https://github.com/discourse/discourse.git
synced 2025-01-31 18:35:31 +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
|
describe "#postgresql_fallback_connection" do
|
||||||
it 'should return a PostgreSQL adapter' do
|
it 'should return a PostgreSQL adapter' do
|
||||||
expect(ActiveRecord::Base.postgresql_fallback_connection(config))
|
begin
|
||||||
.to be_an_instance_of(ActiveRecord::ConnectionAdapters::PostgreSQLAdapter)
|
connection = ActiveRecord::Base.postgresql_fallback_connection(config)
|
||||||
|
|
||||||
|
expect(connection)
|
||||||
|
.to be_an_instance_of(ActiveRecord::ConnectionAdapters::PostgreSQLAdapter)
|
||||||
|
ensure
|
||||||
|
connection.disconnect!
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when master server is down' do
|
context 'when master server is down' do
|
||||||
|
|
Loading…
Reference in New Issue
Block a user