Namespace
Methods
- C
- S
- T
Instance Public methods
call(env)
Link
setup()
Link
# File activerecord/test/cases/connection_management_test.rb, line 18 def setup @env = {} @app = App.new @management = ConnectionManagement.new(@app) # make sure we have an active connection assert ActiveRecord::Base.connection assert ActiveRecord::Base.connection_handler.active_connections? end
test_active_connections_are_not_cleared_on_body_close_during_test()
Link
# File activerecord/test/cases/connection_management_test.rb, line 53 def test_active_connections_are_not_cleared_on_body_close_during_test @env['rack.test'] = true _, _, body = @management.call(@env) body.close assert ActiveRecord::Base.connection_handler.active_connections? end
test_app_delegation()
Link
test_body_responds_to_each()
Link
test_connections_are_active_after_call()
Link
test_connections_are_cleared_after_body_close()
Link
test_connections_closed_if_exception()
Link
# File activerecord/test/cases/connection_management_test.rb, line 60 def test_connections_closed_if_exception app = Class.new(App) { def call(env); raise; end }.new explosive = ConnectionManagement.new(app) assert_raises(RuntimeError) { explosive.call(@env) } assert !ActiveRecord::Base.connection_handler.active_connections? end
test_connections_not_closed_if_exception_and_test()
Link
# File activerecord/test/cases/connection_management_test.rb, line 67 def test_connections_not_closed_if_exception_and_test @env['rack.test'] = true app = Class.new(App) { def call(env); raise; end }.new explosive = ConnectionManagement.new(app) assert_raises(RuntimeError) { explosive.call(@env) } assert ActiveRecord::Base.connection_handler.active_connections? end