Sha256: bbc8fd50852838c62e9092a6c3869086d6b94e1b362d7e3099223947e6250643
Contents?: true
Size: 882 Bytes
Versions: 41
Compression:
Stored size: 882 Bytes
Contents
require 'spec_helper' require 'spec/support/rack_test' require 'spec/support/uses_redis' require 'spec/support/uses_dotenv' require 'spec/support/events' require 'routemaster/drain/basic' require 'json' describe Routemaster::Drain::Basic do uses_dotenv uses_redis let(:app) { described_class.new } let(:listener) { double 'listener' } before { app.subscribe(listener, prefix: true) } let(:path) { '/' } let(:payload) { [1,2,3,1].map { |idx| make_event(idx) }.to_json } let(:environment) {{ 'CONTENT_TYPE' => 'application/json' }} let(:perform) { post path, payload, environment } before { authorize 'd3m0', 'x' } it 'succeeds' do perform expect(last_response.status).to eq(204) end it 'emits events' do expect(listener).to receive(:on_events_received) do |payload| expect(payload.size).to eq(4) end perform end end
Version data entries
41 entries across 41 versions & 1 rubygems