Sha256: 47b7c7470a325e9b03fc2a4b8064def2a1f52b5bd85da6c0bce08a44d78beb4e
Contents?: true
Size: 1.2 KB
Versions: 6
Compression:
Stored size: 1.2 KB
Contents
require 'spec_helper' RSpec.describe GeoConcerns::RabbitMessagingClient do subject { described_class.new(url) } let(:url) { "amqp://test.x.z.s:4000" } let(:config) { { 'events' => { 'exchange' => { 'geoblacklight' => 'gbl_events', 'geoserver' => 'geoserver_events' } } } } let(:exchange) { 'geoblacklight' } let(:message) { { exchange: exchange }.to_json } let(:channel) { instance_double(Bunny::Channel) } let(:bunny_session) { instance_double(Bunny::Session, create_channel: channel) } before do allow(GeoConcerns::Messaging).to receive(:config).and_return(config) allow(Bunny).to receive(:new).and_return(bunny_session) allow(bunny_session).to receive(:start) end describe "#publish" do context 'with a geoblacklight exchange type' do it 'calls the geoblacklight method' do expect(channel).to receive(:fanout).with('gbl_events', durable: true) subject.publish(message) end end context 'with a geoserver exchange type' do let(:exchange) { 'geoserver' } it 'calls the geoserver method' do expect(channel).to receive(:fanout).with('geoserver_events', durable: true) subject.publish(message) end end end end
Version data entries
6 entries across 6 versions & 1 rubygems