spec/unit/daemon/dispatcher/http_spec.rb in rpush-1.0.0-java vs spec/unit/daemon/dispatcher/http_spec.rb in rpush-2.0.0.beta1

- old
+ new

@@ -4,13 +4,14 @@ let(:app) { double } let(:delivery_class) { double } let(:notification) { double } let(:batch) { double } let(:http) { double } + let(:queue_payload) { Rpush::Daemon::QueuePayload.new(batch, notification) } let(:dispatcher) { Rpush::Daemon::Dispatcher::Http.new(app, delivery_class) } - before { Net::HTTP::Persistent.stub(:new => http) } + before { Net::HTTP::Persistent.stub(new: http) } it 'constructs a new persistent connection' do Net::HTTP::Persistent.should_receive(:new) Rpush::Daemon::Dispatcher::Http.new(app, delivery_class) end @@ -18,10 +19,10 @@ describe 'dispatch' do it 'delivers the notification' do delivery = double delivery_class.should_receive(:new).with(app, http, notification, batch).and_return(delivery) delivery.should_receive(:perform) - dispatcher.dispatch(notification, batch) + dispatcher.dispatch(queue_payload) end end describe 'cleanup' do it 'closes the connection' do