Sha256: 8f39bd270301698b67b07a1ee025bd3c2fccb6108b49fb32af95c8896e883c23

Contents?: true

Size: 884 Bytes

Versions: 16

Compression:

Stored size: 884 Bytes

Contents

require 'spec_helper'

describe 'Reply' do
  let(:freddy) { Freddy.build(logger, config) }

  let(:destination) { random_destination }
  let(:request_payload) { { req: 'load' } }
  let(:response_payload) { { res: 'load' } }

  after { freddy.close }

  context 'when a synchronized request' do
    before do
      freddy.respond_to(destination) do |_payload, msg_handler|
        msg_handler.success(response_payload)
      end
    end

    it 'sends reply' do
      response = freddy.deliver_with_response(destination, request_payload)
      expect(response).to eq(response_payload)
    end

    it 'does not send the reply to the topic queue' do
      freddy.tap_into 'amq.*' do |_payload|
        @message_received = true
      end

      freddy.deliver_with_response(destination, request_payload)
      default_sleep

      expect(@message_received).to be_falsy
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
freddy-2.5.1 spec/integration/reply_spec.rb
freddy-2.5.0 spec/integration/reply_spec.rb
freddy-2.5.0.pre.rc.1 spec/integration/reply_spec.rb
freddy-2.4.0 spec/integration/reply_spec.rb
freddy-2.3.0 spec/integration/reply_spec.rb
freddy-2.2.4 spec/integration/reply_spec.rb
freddy-2.2.3 spec/integration/reply_spec.rb
freddy-2.2.2 spec/integration/reply_spec.rb
freddy-2.2.1 spec/integration/reply_spec.rb
freddy-2.2.0 spec/integration/reply_spec.rb
freddy-2.1.0 spec/integration/reply_spec.rb
freddy-2.0.0 spec/integration/reply_spec.rb
freddy-1.7.0 spec/integration/reply_spec.rb
freddy-1.6.0 spec/integration/reply_spec.rb
freddy-1.5.0 spec/integration/reply_spec.rb
freddy-1.4.2 spec/integration/reply_spec.rb