mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 09:04:45 +08:00
Ensure that we disconnect connection in test.
This commit is contained in:
@ -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
|
||||||
|
Reference in New Issue
Block a user