Sha256: 322475e879c8c070c2d38072a958332ecc85b2cb6fe6bc96c962c52eeaf93533

Contents?: true

Size: 847 Bytes

Versions: 7

Compression:

Stored size: 847 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

describe Msgr::Railtie do
  describe 'configuration options' do
    let(:config) { Rails.configuration }

    it 'has `msgr` key' do
      expect(config).to respond_to :msgr
    end
  end

  describe '#load' do
    before do
      allow(Msgr).to receive(:start)
      allow(Msgr.client).to receive(:connect)
    end

    context 'without checkcredentials value' do
      it 'connects to rabbitmq directly to check credentials' do
        described_class.load({})
        expect(Msgr.client).to have_received(:connect)
      end
    end

    context 'with checkcredentials is false' do
      it 'connects to rabbitmq directly to check credentials' do
        described_class.load({checkcredentials: false})
        expect(Msgr.client).not_to have_received(:connect)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
msgr-1.6.1 spec/integration/msgr/railtie_spec.rb
msgr-1.6.0 spec/integration/msgr/railtie_spec.rb
msgr-1.5.0 spec/integration/msgr/railtie_spec.rb
msgr-1.4.0 spec/integration/msgr/railtie_spec.rb
msgr-1.3.2 spec/integration/msgr/railtie_spec.rb
msgr-1.3.1 spec/integration/msgr/railtie_spec.rb
msgr-1.3.0 spec/integration/msgr/railtie_spec.rb