Sha256: 2f139dcd4b5f70fa48b5fd3e418f2bce485342748bc949c11ff4421e1de7673e

Contents?: true

Size: 921 Bytes

Versions: 10

Compression:

Stored size: 921 Bytes

Contents

require 'spec_helper'

describe Maestrano::Connector::Rails::ConnectorLogger do
  subject { Maestrano::Connector::Rails::ConnectorLogger }

  describe 'self.log' do
    let(:organization) { create(:organization) }

    it 'calls rails.logger' do
      expect(Rails.logger).to receive(:info)
      subject.log('info', organization, 'msg')
    end

    it 'includes the organization uid and tenant' do
      expect(Rails.logger).to receive(:info).with("uid=\"#{organization.uid}\", org_uid=\"#{organization.org_uid}\", tenant=\"#{organization.tenant}\", message=\"msg\"")

      subject.log('info', organization, 'msg')
    end

    it 'includes extra params' do
      expect(Rails.logger).to receive(:info).with("uid=\"#{organization.uid}\", org_uid=\"#{organization.org_uid}\", tenant=\"#{organization.tenant}\", foo=\"bar\", message=\"msg\"")

      subject.log('info', organization, 'msg', foo: :bar)
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
maestrano-connector-rails-2.0.2.pre.RC6 spec/models/connector_logger_spec.rb
maestrano-connector-rails-2.0.2.pre.RC5 spec/models/connector_logger_spec.rb
maestrano-connector-rails-2.0.2.pre.RC4 spec/models/connector_logger_spec.rb
maestrano-connector-rails-2.0.2.pre.RC3 spec/models/connector_logger_spec.rb
maestrano-connector-rails-2.0.2.pre.RC2 spec/models/connector_logger_spec.rb
maestrano-connector-rails-2.0.2.pre.RC1 spec/models/connector_logger_spec.rb
maestrano-connector-rails-2.0.1 spec/models/connector_logger_spec.rb
maestrano-connector-rails-2.0.0 spec/models/connector_logger_spec.rb
maestrano-connector-rails-2.0.0.pre.RC13 spec/models/connector_logger_spec.rb
maestrano-connector-rails-2.0.0.pre.RC12 spec/models/connector_logger_spec.rb