Sha256: 7c07a56820e2c7ec05c5414a0f4ce911c61f6b5408ce3009a5aee1b70ab43a83

Contents?: true

Size: 915 Bytes

Versions: 2

Compression:

Stored size: 915 Bytes

Contents

require 'spec_helper'

# Unable to run controller tests because of this issue https://github.com/rspec/rspec-rails/issues/469
module Esendex
  describe MessageDeliveredEventsController do
    describe "#create" do
      let(:id) { random_string }
      let(:message_id) { random_string }
      let(:account_id) { random_string }
      let(:occurred_at) { random_time.utc }
      let(:source) {
        "<MessageDelivered>
           <Id>#{id}</Id>
           <MessageId>#{message_id}</MessageId>
           <AccountId>#{account_id}</AccountId>
           <OccurredAt>#{occurred_at.strftime("%Y-%m-%dT%H:%M:%S")}</OccurredAt>
          </MessageDelivered>"
      }
      subject { 
        controller.request.env['RAW_POST_DATA'] = source
        post :create
      }

      # it "should be successful" do
      #   subject
      #   response.should eq(200)
      # end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
esendex-0.6.0 spec/controllers/message_delivered_events_controller_spec.rb
esendex-0.5.0 spec/controllers/message_delivered_events_controller_spec.rb