Sha256: 1b31ce6fb335b89318cbe856ed583f2d1a5a6c6cbe127e24b57e12312977d941

Contents?: true

Size: 424 Bytes

Versions: 3

Compression:

Stored size: 424 Bytes

Contents

shared_context "with query cache enabled" do
  let!(:counter) { ActiveRecord::QueryCounter.new }

  before(:each) do
    ActiveRecord::Base.connection.enable_query_cache!
    counter.query_count = 0
  end

  after(:each) do 
    ActiveRecord::Base.connection.disable_query_cache!
  end

  around(:each) do |example|
    active_support_subscribed(counter.to_proc, 'sql.active_record') do 
      example.run
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ar-octopus-0.8.2 spec/support/shared_contexts.rb
ar-octopus-0.8.1 spec/support/shared_contexts.rb
ar-octopus-0.8.0 spec/support/shared_contexts.rb