Sha256: 91cc7f9550014a03cc1ecf1c2ba210da300d26b313f69e9ec1b26eeaeae0b424
Contents?: true
Size: 716 Bytes
Versions: 65
Compression:
Stored size: 716 Bytes
Contents
require "cases/helper" class ConnectionManagementTest < ActiveRecord::TestCase def setup @env = {} @app = stub('App') @management = ActiveRecord::ConnectionAdapters::ConnectionManagement.new(@app) @connections_cleared = false ActiveRecord::Base.stubs(:clear_active_connections!).with { @connections_cleared = true } end test "clears active connections after each call" do @app.expects(:call).with(@env) @management.call(@env) assert @connections_cleared end test "doesn't clear active connections when running in a test case" do @env['rack.test'] = true @app.expects(:call).with(@env) @management.call(@env) assert !@connections_cleared end end
Version data entries
65 entries across 64 versions & 12 rubygems