Sha256: 9bfb592d8b4f429f389735482a5ce71b3488a17a6ebbb45b7778a3184f4301da

Contents?: true

Size: 809 Bytes

Versions: 4

Compression:

Stored size: 809 Bytes

Contents

require 'spec_helper'

describe Mandrill::WebHook::Processor do

  let(:params) { {} }
  let(:processor) { Mandrill::WebHook::Processor.new(params) }

  describe "#run!" do
    context "with inbound events" do
      before do
        Mandrill::WebHook::Processor.stub(:handle_inbound)
      end
      let(:event1) { { "event" => "inbound" } }
      let(:event2) { { "event" => "inbound" } }
      let(:params) { { "mandrill_events" => [event1,event2].to_json } }
      it "should pass event payload to the handler" do
        processor.should_receive(:handle_inbound).twice
        processor.run!
      end
    end
  end

  describe "#wrap_payload" do
    let(:raw_payload) { {} }
    subject { processor.wrap_payload(raw_payload) }
    its(:class) { should eql(Mandrill::WebHook::EventDecorator) }
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mandrill-rails-0.0.4 spec/mandrill/web_hook/processor_spec.rb
mandrill-rails-0.0.3 spec/mandrill/web_hook/processor_spec.rb
mandrill-rails-0.0.2 spec/mandrill/web_hook/processor_spec.rb
mandrill-rails-0.0.1 spec/mandrill/web_hook/processor_spec.rb