From aea1477362b640ebe52cf991b915ad32e7bf2571 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 28 Mar 2011 17:47:46 -0700 Subject: make sure we have an active database connection before running each connection management test --- activerecord/test/cases/connection_management_test.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'activerecord/test') diff --git a/activerecord/test/cases/connection_management_test.rb b/activerecord/test/cases/connection_management_test.rb index 82ea46b41f..1313e28bb1 100644 --- a/activerecord/test/cases/connection_management_test.rb +++ b/activerecord/test/cases/connection_management_test.rb @@ -20,8 +20,9 @@ module ActiveRecord @app = App.new @management = ConnectionManagement.new(@app) - @connections_cleared = false - ActiveRecord::Base.stubs(:clear_active_connections!).with { @connections_cleared = true } + # make sure we have an active connection + assert ActiveRecord::Base.connection + assert ActiveRecord::Base.connection_handler.active_connections? end def test_app_delegation @@ -33,13 +34,13 @@ module ActiveRecord test "clears active connections after each call" do @management.call(@env) - assert @connections_cleared + assert !ActiveRecord::Base.connection_handler.active_connections? end test "doesn't clear active connections when running in a test case" do @env['rack.test'] = true @management.call(@env) - assert !@connections_cleared + assert ActiveRecord::Base.connection_handler.active_connections? end end end -- cgit v1.2.3