Sha256: 82c2c6e43361f1a55c0b8a9b1439da83f6457efe285d502bc7d3169de40df2cc
Contents?: true
Size: 777 Bytes
Versions: 1
Compression:
Stored size: 777 Bytes
Contents
require 'spec_helper' require 'logger' describe ActiveRecord::LogSubscriber do describe 'logging' do let(:log) { StringIO.new } let(:logger) { Logger.new(log) } before do ActiveRecord::Base.logger = logger end after do Slavery.disabled = false end it 'it prefixes log messages with master' do User.count log.rewind expect(log.read).to include('[master]') end it 'it prefixes log messages with the slave connection' do User.on_slave.count log.rewind expect(log.read).to include('[slave]') end it 'it does nothing when slavery is disabled' do Slavery.disabled = true User.count log.rewind expect(log.read).to_not include('[master]') end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
slavery-2.1.0 | spec/active_record/log_subscriber_spec.rb |