Module: TestHelpers::SMSGlobal

Defined in:
lib/action_sms_gateways/connection_adapters/test_helpers/sms_global.rb

Instance Method Summary collapse

Instance Method Details

#sample_delivery_receipt(options = {}) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/action_sms_gateways/connection_adapters/test_helpers/sms_global.rb', line 26

def sample_delivery_receipt(options = {})
  options[:message_id] ||= "6942744494999745"
  options[:status] ||= "DELIVRD"
  options[:error] ||= "000"
  options[:date] ||= "1005132312"
  {
    "msgid"=> options[:message_id],
    "dlrstatus"=> options[:status],
    "dlr_err"=> options[:error],
    "donedate"=> options[:date]
  }
end

#sample_delivery_response(options = {}) ⇒ Object



18
19
20
# File 'lib/action_sms_gateways/connection_adapters/test_helpers/sms_global.rb', line 18

def sample_delivery_response(options = {})
  options[:failed] ? "ERROR: No action requested" : "OK: 0; Sent queued message ID: 86b1a945370734f4 SMSGlobalMsgID:6942744494999745"
end

#sample_incoming_sms(options = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/action_sms_gateways/connection_adapters/test_helpers/sms_global.rb', line 3

def sample_incoming_sms(options = {})
  options[:message] ||= "Endia kasdf ofeao"
  options[:to]      ||= "61447100308"
  options[:from]    ||= "61447100399"
  options[:date]    ||= "2010-05-13 23:59:11"
  params = {
    "to" => options[:to],
    "from" => options[:from],
    "msg"=> options[:message],
    "date" => options[:date]
  }
  params.merge!("userfield" => @config[:authentication_key]) unless options[:authentic] == false
  params
end

#sample_message_idObject



22
23
24
# File 'lib/action_sms_gateways/connection_adapters/test_helpers/sms_global.rb', line 22

def sample_message_id
  "SMSGlobalMsgID:6942744494999745"
end