Sha256: bb4f1a2033a59fec21d89fbbe9420e2d05c3ad31a14328970e30566885f8dd46
Contents?: true
Size: 610 Bytes
Versions: 3
Compression:
Stored size: 610 Bytes
Contents
require 'spec_helper' RSpec.describe Grape::App::Middleware::ConnectionManagement do include Rack::Test::Methods let :app do failing = ->(_) { raise(ActiveRecord::StatementInvalid) } middleware = described_class Rack::Builder.new do use middleware run failing end end it 'clears active connections' do ActiveRecord::Base.connection expect(ActiveRecord::Base.connection_handler).to be_active_connections expect { get '/' }.to raise_error(ActiveRecord::StatementInvalid) expect(ActiveRecord::Base.connection_handler).not_to be_active_connections end end
Version data entries
3 entries across 3 versions & 1 rubygems