Sha256: 1eaae5551f145fd6e8e568b0421352352c8ab24f6b75976fa2bc4ff5662c9c8c

Contents?: true

Size: 1.12 KB

Versions: 4

Compression:

Stored size: 1.12 KB

Contents

require 'spec_helper'

describe InboundMessage do
  describe ".from_xml" do
    let(:id) { random_string }
    let(:message_id) { random_string }
    let(:account_id) { random_string }
    let(:message_text) { random_string }
    let(:from) { random_mobile }
    let(:to) { random_mobile }
    let(:source) {
      "<InboundMessage>
         <Id>#{id}</Id>
         <MessageId>#{message_id}</MessageId>
         <AccountId>#{account_id}</AccountId>
         <MessageText>#{message_text}</MessageText>
         <From>#{from}</From>
         <To>#{to}</To>
       </InboundMessage>"
    }

    subject { InboundMessage.from_xml source }

    it "should set the id" do
      subject.id.should eq(id)
    end
    it "should set the message_id" do
      subject.message_id.should eq(message_id)
    end
    it "should set the account_id" do
      subject.account_id.should eq(account_id)
    end
    it "should set the message_text" do
      subject.message_text.should eq(message_text)
    end
    it "should set the from" do
      subject.from.should eq(from)
    end
    it "should set the to" do
      subject.to.should eq(to)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
esendex-0.4.0 spec/inbound_message_spec.rb
esendex-0.3.2 spec/inbound_message_spec.rb
esendex-0.3.1 spec/inbound_message_spec.rb
esendex-0.3.0 spec/inbound_message_spec.rb