Sha256: bde71ece9aafc6a40685234fb24aef59769f65c2f3cab802c97dbac37c775f25

Contents?: true

Size: 878 Bytes

Versions: 28

Compression:

Stored size: 878 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

28 entries across 28 versions & 2 rubygems

Version Path
freddy-1.4.1 spec/integration/reply_spec.rb
freddy-1.4.0 spec/integration/reply_spec.rb
freddy-1.3.3 spec/integration/reply_spec.rb
freddy-jruby-1.3.2 spec/integration/reply_spec.rb
freddy-1.3.2 spec/integration/reply_spec.rb
freddy-1.3.1 spec/integration/reply_spec.rb
freddy-1.3.0 spec/integration/reply_spec.rb
freddy-1.2.0 spec/integration/reply_spec.rb
freddy-1.1.0 spec/integration/reply_spec.rb
freddy-1.0.1 spec/integration/reply_spec.rb
freddy-jruby-1.0.0 spec/integration/reply_spec.rb
freddy-1.0.0 spec/integration/reply_spec.rb
freddy-jruby-0.7.2 spec/integration/reply_spec.rb
freddy-0.7.2 spec/integration/reply_spec.rb
freddy-0.7.1 spec/integration/reply_spec.rb
freddy-0.7.0 spec/integration/reply_spec.rb
freddy-0.6.3 spec/integration/reply_spec.rb
freddy-0.6.2 spec/integration/reply_spec.rb
freddy-0.6.1 spec/integration/reply_spec.rb
freddy-jruby-0.6.0 spec/integration/reply_spec.rb