Sha256: fdfa19ad52e1cb6d93ff5614bc636cf86ca786d29721e4b6702dad0d486b11b4

Contents?: true

Size: 930 Bytes

Versions: 3

Compression:

Stored size: 930 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
require 'builder'

describe "Response" do
  before(:each) do
    @xml = <<EOXML
<?xml version="1.0" encoding="utf-8"?>
<SmsReturn xmlns="http://ws.cdyne.com/SmsWS/">
  <StatusCode>1</StatusCode>
  <StatusText>Success</StatusText>
  <Completed>1</Completed>
  <TextID>12345678</TextID>
  <Demo>0</Demo>
  <ScheduledTime></ScheduledTime>
  <Responded>0</Responded>
</SmsReturn>
EOXML
  end
  
  after(:each) do
    @xml = ''
  end

  it "should convert an xml response body into a hash" do
    @response_hash = {
      "sms_return" => {
        "status_code"=>"1",
        "status_text"=>"Success",
        "completed"=>"1",
        "text_id"=>"12345678",
        "demo"=>"0",
        "scheduled_time"=>nil,
        "responded"=>"0",
        "xmlns"=>"http://ws.cdyne.com/SmsWS/"
      }
    }
    SmsNotify::Response.parse(@xml).should == @response_hash
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cdyne-sms-notify-0.8.0 spec/response_spec.rb
cdyne-sms-notify-0.7.1 spec/response_spec.rb
cdyne-sms-notify-0.7.0 spec/response_spec.rb