Module: TestHelpers::Tropo
- Defined in:
- lib/action_sms_gateways/connection_adapters/test_helpers/tropo.rb
Instance Method Summary collapse
-
#sample_delivery_receipt(options = {}) ⇒ Object
This is here simply so the current tests pass Tropo does not yet send delivery receipts.
- #sample_delivery_response(options = {}) ⇒ Object
- #sample_incoming_sms(options = {}) ⇒ Object
- #sample_message_id ⇒ Object
Instance Method Details
#sample_delivery_receipt(options = {}) ⇒ Object
This is here simply so the current tests pass Tropo does not yet send delivery receipts
56 57 58 59 60 61 62 63 64 65 |
# File 'lib/action_sms_gateways/connection_adapters/test_helpers/tropo.rb', line 56 def sample_delivery_receipt( = {}) [:message_id] ||= "123e71195545ad204bdd99f2070a7d86" [:status] ||= "delivered" [:date] ||= "Mon Oct 11 09:21:38 UTC 2010" { "message_id"=> [:message_id], "status"=> [:status], "delivered_at"=> [:date] } end |
#sample_delivery_response(options = {}) ⇒ Object
46 47 48 |
# File 'lib/action_sms_gateways/connection_adapters/test_helpers/tropo.rb', line 46 def sample_delivery_response( = {}) [:failure] ? "<session><success>false</success><token></token><reason>FAILED TO ROUTE TOKEN</reason></session>" : "<session><success>true</success></session>" end |
#sample_incoming_sms(options = {}) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/action_sms_gateways/connection_adapters/test_helpers/tropo.rb', line 3 def sample_incoming_sms( = {}) [:message] ||= "Endia kasdf ofeao" [:to] ||= "61447100308" [:from] ||= "61447100399" [:date] ||= "Mon Oct 11 09:21:38 UTC 2010" params = { "session" => { "id"=>"12349516546e59746d6a89a990466789", "account_id"=>"12345", "timestamp"=> [:date], "user_type"=>"HUMAN", "initial_text"=> [:message], "call_id"=>"123e71195545ad204bdd99f2070a7d86", "to"=>{ "id"=> [:to], "name"=>"unknown", "channel"=>"TEXT", "network"=>"SMS" }, "from" => { "id"=> [:from], "name"=>"unknown", "channel"=>"TEXT", "network"=>"SMS" }, "headers" => { "_max-_forwards"=>"70", "_content-_length"=>"124", "_contact"=>"<sip:11.8.93.101:5066;transport=udp>", "_to"=>"<sip:[email protected]:5061;to=#{[:to]}>", "_c_seq"=>"1 INVITE", "_via"=>"SIP/2.0/UDP 11.8.93.101:5066;branch=h0hG4bKk5sy1e", "_call-_i_d"=>"ieeg18", "_content-_type"=>"application/sdp", "_from"=>"<sip:[email protected];channel=private;user=#{[:to]};msg=#{[:message]};network=SMS;step=1>;tag=zm13kt" } } } params.merge!("authentication_key" => @config[:authentication_key]) unless [:authentic] == false params end |
#sample_message_id ⇒ Object
50 51 52 |
# File 'lib/action_sms_gateways/connection_adapters/test_helpers/tropo.rb', line 50 def "123e71195545ad204bdd99f2070a7d86" end |