Sha256: b1878c48f0f18d32baec470966c4cbec465f2418516e8a53b6773da90bf4355a

Contents?: true

Size: 921 Bytes

Versions: 13

Compression:

Stored size: 921 Bytes

Contents

module RabbitFeed
  module TestingSupport
    describe TestingHelpers do
      describe 'consuming events' do
        accumulator = []

        let(:define_route) do
          EventRouting do
            accept_from('some_place') do
              event('some_event') do |event|
                accumulator << event
              end
            end
          end
        end

        let(:payload)  { {'stuff' => 'some_stuff'} }
        let(:metadata) { {'application' => 'some_place', 'name' => 'some_event'} }
        let(:event)    { Event.new metadata, payload }

        before { define_route }

        it 'should allow to send messages directly to the consumer' do
          rabbit_feed_consumer.consume_event event
          expect(accumulator.size).to eq(1)
          expect(accumulator[0].payload).to eq(payload)
          expect(accumulator[0].metadata).to eq(metadata)
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
rabbit_feed-2.4.4 spec/lib/rabbit_feed/testing_support/testing_helper_spec.rb
rabbit_feed-2.4.3 spec/lib/rabbit_feed/testing_support/testing_helper_spec.rb
rabbit_feed-2.4.2 spec/lib/rabbit_feed/testing_support/testing_helper_spec.rb
rabbit_feed-2.4.1 spec/lib/rabbit_feed/testing_support/testing_helper_spec.rb
rabbit_feed-2.4.0 spec/lib/rabbit_feed/testing_support/testing_helper_spec.rb
rabbit_feed-2.3.10 spec/lib/rabbit_feed/testing_support/testing_helper_spec.rb
rabbit_feed-2.3.9 spec/lib/rabbit_feed/testing_support/testing_helper_spec.rb
rabbit_feed-2.3.7 spec/lib/rabbit_feed/testing_support/testing_helper_spec.rb
rabbit_feed-2.3.6 spec/lib/rabbit_feed/testing_support/testing_helper_spec.rb
rabbit_feed-2.3.5 spec/lib/rabbit_feed/testing_support/testing_helper_spec.rb
rabbit_feed-2.3.4 spec/lib/rabbit_feed/testing_support/testing_helper_spec.rb
rabbit_feed-2.3.3 spec/lib/rabbit_feed/testing_support/testing_helper_spec.rb
rabbit_feed-2.3.2 spec/lib/rabbit_feed/testing_support/testing_helper_spec.rb