DEV: Avoid leaking `AR::Base.connection_handler` across tests.

DEV: Avoid leaking AR::Base.connection_handler across tests.

diff --git a/spec/connection_management_spec.rb b/spec/connection_management_spec.rb
index 44ed48d..704b907 100644
--- a/spec/connection_management_spec.rb
+++ b/spec/connection_management_spec.rb
@@ -17,10 +17,13 @@ describe RailsMultisite::ConnectionManagement do
   end
 
   def with_connection(db)
+    original_connection_handler = ActiveRecord::Base.connection_handler
+    original_connection_handler.clear_active_connections!
     conn.establish_connection(db: db)
     yield ActiveRecord::Base.connection.raw_connection
   ensure
     ActiveRecord::Base.connection_handler.clear_active_connections!
+    ActiveRecord::Base.connection_handler = original_connection_handler
   end
 
   context 'default' do
@@ -85,6 +88,8 @@ describe RailsMultisite::ConnectionManagement do
       with_connection(:second) do
         expect(conn.current_db).to eq('second')
       end
+
+      expect(conn.current_db).to eq('default')
     end
 
     it "can exectue a queries concurrently per db" do

GitHub sha: 9b49b507