Sha256: b9359d562f8526c1c94e242849f7b11272f13ac49aeb933e787d02d59bc9534c

Contents?: true

Size: 1.25 KB

Versions: 1

Compression:

Stored size: 1.25 KB

Contents

require_relative 'test_helper'
require_relative '../lib/smart-mobile'

describe Smart do

  before do
    @sms = Smart::REST::SMS.new
  end
  
  def valid_sms_data
    {"outboundSMSMessageRequest" => 
      {"address" => ["tel:+639176230655"], 
        "senderAddress" => config_file['access_code'].to_s,
        "outboundSMSTextMessage" => {
          "message" => "Test Message"
        }
      }
    }
  end

  def client
    @client ||= initialize_rest_client 
  end

  def initialize_rest_client
    Smart::REST::Client.configure do |config|
      config.sp_id = config_file['sp_id']
      config.sp_password = config_file['sp_password'].to_s
      config.service_id = config_file['service_id']
      config.access_code = config_file['access_code'].to_s
      config.path_to_cert = config_file['path_to_cert']
      config.creation_time = config_file['creation_time']
      config.nonce = config_file['nonce']
    end
  end

  it 'should not allow for invalid sp_password' do
    begin
      response = client.send_sms(valid_sms_data)
    rescue Exception => e
      e.message.must_equal Smart::REST::Response.new('SVC0901').to_s
    end
  end
  
  it 'should have a valid certificate' do

  end
  
  it 'should try to retry up to the max number of retry limited' do
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
smart-mobile-0.0.1 test/test_smart.rb