mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
Ensure that we disconnect connection in test.
This commit is contained in:
parent
fffb7561c4
commit
b1375ef44e
1 changed files with 8 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue