telnyx 0.1.0 → 2.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/.github/scripts/before_install.sh +9 -0
  3. data/.github/workflows/ruby.yml +39 -0
  4. data/.gitignore +3 -0
  5. data/.rubocop.yml +6 -36
  6. data/.rubocop_todo.yml +300 -0
  7. data/.travis.yml.bak +48 -0
  8. data/Gemfile +6 -6
  9. data/README.md +2 -1
  10. data/VERSION +1 -1
  11. data/bin/telnyx-console +5 -0
  12. data/examples/2 factor authentication/Gemfile +7 -0
  13. data/examples/2 factor authentication/main.rb +67 -0
  14. data/examples/2 factor authentication/readme.md +5 -0
  15. data/examples/fax/Gemfile +7 -0
  16. data/examples/fax/config.yaml +4 -0
  17. data/examples/fax/fax.rb +42 -0
  18. data/examples/fax/options.rb +41 -0
  19. data/examples/fax/readme.md +18 -0
  20. data/lib/telnyx.rb +6 -1
  21. data/lib/telnyx/api_operations/save.rb +1 -1
  22. data/lib/telnyx/api_resource.rb +14 -3
  23. data/lib/telnyx/call.rb +3 -1
  24. data/lib/telnyx/conference.rb +17 -1
  25. data/lib/telnyx/fax.rb +13 -0
  26. data/lib/telnyx/fax_application.rb +12 -0
  27. data/lib/telnyx/messaging_phone_number.rb +9 -0
  28. data/lib/telnyx/number_lookup.rb +7 -0
  29. data/lib/telnyx/phone_number.rb +9 -1
  30. data/lib/telnyx/phone_number_regulatory_requirement.rb +1 -0
  31. data/lib/telnyx/sim_card.rb +12 -1
  32. data/lib/telnyx/telnyx_client.rb +16 -25
  33. data/lib/telnyx/util.rb +12 -6
  34. data/lib/telnyx/verification.rb +27 -0
  35. data/lib/telnyx/verify_profile.rb +11 -0
  36. data/lib/telnyx/version.rb +1 -1
  37. data/telnyx.gemspec +2 -2
  38. data/test/telnyx/call_control_test.rb +54 -30
  39. data/test/telnyx/conference_test.rb +57 -20
  40. data/test/telnyx/credential_connection_test.rb +5 -1
  41. data/test/telnyx/fax_application_test.rb +32 -0
  42. data/test/telnyx/fax_test.rb +32 -0
  43. data/test/telnyx/fqdn_connection_test.rb +1 -1
  44. data/test/telnyx/fqdn_test.rb +1 -1
  45. data/test/telnyx/messaging_phone_number_test.rb +8 -4
  46. data/test/telnyx/messaging_profile_test.rb +1 -1
  47. data/test/telnyx/number_lookup_test.rb +18 -0
  48. data/test/telnyx/phone_number_regulatory_requirement_test.rb +1 -1
  49. data/test/telnyx/phone_number_test.rb +14 -21
  50. data/test/telnyx/sim_card_test.rb +6 -6
  51. data/test/telnyx/telnyx_object_test.rb +5 -5
  52. data/test/telnyx/verification_test.rb +22 -0
  53. data/test/telnyx/verify_profile_test.rb +31 -0
  54. data/test/test_helper.rb +1 -1
  55. metadata +55 -12
  56. data/.travis.yml +0 -51
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ class NumberLookup < APIResource
5
+ RESOURCE_PATH = OBJECT_NAME = "number_lookup".freeze
6
+ end
7
+ end
@@ -13,7 +13,7 @@ module Telnyx
13
13
  instance_methods: { list: "voice" }
14
14
  nested_resource_class_methods "messaging",
15
15
  path: ["messaging"],
16
- operations: %i[update list],
16
+ operations: %i[update list retrieve],
17
17
  instance_methods: { list: "messaging" }
18
18
  nested_resource_class_methods "inbound_channel",
19
19
  path: ["inbound_channels"],
@@ -35,6 +35,14 @@ module Telnyx
35
35
  self.class.list_inbound_channels(nil).channels
36
36
  end
37
37
 
38
+ def self.list_voice
39
+ list_voices nil
40
+ end
41
+
42
+ def self.messaging
43
+ list_messagings(nil)
44
+ end
45
+
38
46
  OBJECT_NAME = "phone_number".freeze
39
47
  end
40
48
  end
@@ -5,5 +5,6 @@ module Telnyx
5
5
  extend APIOperations::List
6
6
 
7
7
  OBJECT_NAME = "phone_number_regulatory_requirement".freeze
8
+ RESOURCE_PATH = "phone_numbers_regulatory_requirements".freeze
8
9
  end
9
10
  end
@@ -6,7 +6,7 @@ module Telnyx
6
6
  extend APIOperations::NestedResource
7
7
  extend APIOperations::List
8
8
 
9
- ACTIONS = %w[deactivate activate].freeze
9
+ ACTIONS = %w[enable disable].freeze
10
10
  ACTIONS.each do |action|
11
11
  nested_resource_class_methods action,
12
12
  path: %W[actions #{action}],
@@ -20,5 +20,16 @@ module Telnyx
20
20
  end
21
21
 
22
22
  OBJECT_NAME = "sim_card".freeze
23
+
24
+ # depreciated api
25
+ def activate
26
+ warn "[DEPRECATION] SimCard#activate is deprecated, use enable instead."
27
+ enable
28
+ end
29
+
30
+ def deactivate
31
+ warn "[DEPRECATION] SimCard#deactivate is deprecated, use enable instead."
32
+ disable
33
+ end
23
34
  end
24
35
  end
@@ -240,7 +240,7 @@ module Telnyx
240
240
  end
241
241
 
242
242
  case e
243
- when Faraday::ClientError
243
+ when Faraday::Error
244
244
  if e.response
245
245
  handle_error_response(e.response, error_context)
246
246
  else
@@ -310,30 +310,21 @@ module Telnyx
310
310
  json_body: resp.data,
311
311
  }
312
312
 
313
- case resp.http_status
314
- when 400
315
- InvalidRequestError.new(error_list, opts)
316
- when 401
317
- AuthenticationError.new(error_list, opts)
318
- when 403
319
- PermissionError.new(error_list, opts)
320
- when 404
321
- ResourceNotFoundError.new(error_list, opts)
322
- when 405
323
- MethodNotSupportedError.new(error_list, opts)
324
- when 408
325
- TimeoutError.new(error_list, opts)
326
- when 422
327
- InvalidParametersError.new(error_list, opts)
328
- when 429
329
- RateLimitError.new(error_list, opts)
330
- when 500
331
- APIError.new(error_list, opts)
332
- when 503
333
- ServiceUnavailableError.new(error_list, opts)
334
- else
335
- APIError.new(error_list, opts)
336
- end
313
+ err_class = case resp.http_status
314
+ when 400 then InvalidRequestError
315
+ when 401 then AuthenticationError
316
+ when 403 then PermissionError
317
+ when 404 then ResourceNotFoundError
318
+ when 405 then MethodNotSupportedError
319
+ when 408 then TimeoutError
320
+ when 422 then InvalidParametersError
321
+ when 429 then RateLimitError
322
+ when 500 then APIError
323
+ when 503 then ServiceUnavailableError
324
+ else APIError
325
+ end
326
+
327
+ err_class.new(error_list, **opts)
337
328
  end
338
329
 
339
330
  def handle_network_error(e, context, num_retries, api_base = nil)
data/lib/telnyx/util.rb CHANGED
@@ -48,27 +48,33 @@ module Telnyx
48
48
  Conferences::OBJECT_NAME => Conferences,
49
49
  Connection::OBJECT_NAME => Connection,
50
50
  CredentialConnection::OBJECT_NAME => CredentialConnection,
51
- FQDNConnection::OBJECT_NAME => FQDNConnection,
51
+ Fax::OBJECT_NAME => Fax,
52
+ FaxApplication::OBJECT_NAME => FaxApplication,
52
53
  FQDN::OBJECT_NAME => FQDN,
54
+ FQDNConnection::OBJECT_NAME => FQDNConnection,
53
55
  IP::OBJECT_NAME => IP,
54
56
  IPConnection::OBJECT_NAME => IPConnection,
55
57
  Message::OBJECT_NAME => Message,
56
58
  MessagingPhoneNumber::OBJECT_NAME => MessagingPhoneNumber,
59
+ "messaging_settings" => MessagingPhoneNumber,
57
60
  MessagingProfile::OBJECT_NAME => MessagingProfile,
61
+ NumberLookup::OBJECT_NAME => NumberLookup,
58
62
  NumberOrder::OBJECT_NAME => NumberOrder,
59
63
  NumberOrderDocument::OBJECT_NAME => NumberOrderDocument,
60
- "phone_number_reservation" => NumberReservation,
61
64
  NumberReservation::OBJECT_NAME => NumberReservation,
65
+ OutboundVoiceProfile::OBJECT_NAME => OutboundVoiceProfile,
62
66
  PhoneNumber::OBJECT_NAME => PhoneNumber,
67
+ "phone_number_reservation" => NumberReservation,
63
68
  PhoneNumberRegulatoryRequirement::OBJECT_NAME => PhoneNumberRegulatoryRequirement,
64
69
  "phone_number_regulatory_group" => PhoneNumberRegulatoryRequirement,
65
70
  Portout::OBJECT_NAME => Portout,
71
+ VerifyProfile::OBJECT_NAME => VerifyProfile,
66
72
  PublicKey::OBJECT_NAME => PublicKey,
67
- WirelessDetailRecordsReport::OBJECT_NAME => WirelessDetailRecordsReport,
68
- # 'phone_number_regulatory_group' => RegulatoryRequirement,
69
73
  RegulatoryRequirement::OBJECT_NAME => RegulatoryRequirement,
70
74
  SimCard::OBJECT_NAME => SimCard,
71
- OutboundVoiceProfile::OBJECT_NAME => OutboundVoiceProfile,
75
+ Verification::OBJECT_NAME => Verification,
76
+ "verification" => Verification::Response,
77
+ WirelessDetailRecordsReport::OBJECT_NAME => WirelessDetailRecordsReport,
72
78
  }
73
79
  end
74
80
 
@@ -86,7 +92,7 @@ module Telnyx
86
92
  #
87
93
  # ==== Attributes
88
94
  #
89
- # * +data+ - Hash of fields and values to be converted into a TelnyxObject.
95
+ # * +Data+ - Hash of fields and values to be converted into a TelnyxObject.
90
96
  # * +opts+ - Options for +TelnyxObject+ like an API key that will be reused
91
97
  # on subsequent API calls.
92
98
  def self.convert_to_telnyx_object(data, opts = {})
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ class Verification < APIResource
5
+ # Type for verification responses
6
+ class Response < TelnyxObject; end
7
+
8
+ extend APIOperations::Create
9
+ extend APIOperations::NestedResource
10
+
11
+ nested_resource_class_methods "by_telephone",
12
+ path: "by_tn",
13
+ operations: [:retrieve],
14
+ instance_methods: {
15
+ retrieve: "by_telephone",
16
+ }
17
+
18
+ def self.submit_code(phone_number: nil, code: nil)
19
+ url = "#{resource_url}/by_phone_number/#{CGI.escape phone_number}/actions/verify"
20
+ resp, _opts = request(:post, url, code: code)
21
+ Response.construct_from resp.data[:data]
22
+ end
23
+
24
+ OBJECT_NAME = "verify_verification".freeze
25
+ RESOURCE_PATH = "verifications".freeze
26
+ end
27
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ class VerifyProfile < APIResource
5
+ extend APIOperations::List
6
+ extend APIOperations::Create
7
+ include APIOperations::Save
8
+
9
+ OBJECT_NAME = "verify_profile".freeze
10
+ end
11
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Telnyx
4
- VERSION = "0.1.0".freeze
4
+ VERSION = "2.6.0".freeze
5
5
  end
data/telnyx.gemspec CHANGED
@@ -22,8 +22,8 @@ Gem::Specification.new do |s|
22
22
  "source_code_uri" => "https://github.com/team-telnyx/telnyx-ruby",
23
23
  }
24
24
 
25
- s.add_dependency("faraday", "~> 0.13", "!= 0.16.0", "!= 0.16.1", "!= 0.16.2")
26
- s.add_dependency("net-http-persistent", "~> 3.0")
25
+ s.add_dependency("faraday", ">= 0.13", "< 2.0", "!= 0.16.0", "!= 0.16.1", "!= 0.16.2", "!= 0.17.1")
26
+ s.add_dependency("net-http-persistent", ">= 3.0", "< 5.0")
27
27
  s.add_dependency("ed25519", "~> 1")
28
28
 
29
29
  s.files = `git ls-files`.split("\n")
@@ -66,95 +66,119 @@ module Telnyx
66
66
  should "send all commands" do
67
67
  @call = Call.new
68
68
  @call.id = "1234"
69
- @call.reject
70
- assert_requested :post, format_url(@call, "reject")
69
+ @call.reject cause: "CALL_REJECTED"
70
+ assert_requested :post, format_action_url(@call, "reject")
71
71
  @call.answer
72
- assert_requested :post, format_url(@call, "answer")
72
+ assert_requested :post, format_action_url(@call, "answer")
73
73
  @call.hangup
74
- assert_requested :post, format_url(@call, "hangup")
74
+ assert_requested :post, format_action_url(@call, "hangup")
75
75
  @call.bridge call_control_id: SecureRandom.base64(20)
76
- assert_requested :post, format_url(@call, "bridge")
76
+ assert_requested :post, format_action_url(@call, "bridge")
77
77
  @call.speak language: "en-US", voice: "female", payload: "Telnyx call control test"
78
- assert_requested :post, format_url(@call, "speak")
78
+ assert_requested :post, format_action_url(@call, "speak")
79
79
  @call.fork_start call_control_id: SecureRandom.base64(20)
80
- assert_requested :post, format_url(@call, "fork_start")
80
+ assert_requested :post, format_action_url(@call, "fork_start")
81
81
  @call.fork_stop
82
- assert_requested :post, format_url(@call, "fork_stop")
82
+ assert_requested :post, format_action_url(@call, "fork_stop")
83
83
  @call.gather_using_audio audio_url: "https://audio.example.com"
84
- assert_requested :post, format_url(@call, "gather_using_audio")
84
+ assert_requested :post, format_action_url(@call, "gather_using_audio")
85
85
  @call.gather_using_speak language: "en-US", voice: "female", payload: "Telnyx call control test"
86
- assert_requested :post, format_url(@call, "gather_using_speak")
86
+ assert_requested :post, format_action_url(@call, "gather_using_speak")
87
87
  @call.playback_start audio_url: "https://audio.example.com"
88
- assert_requested :post, format_url(@call, "playback_start")
88
+ assert_requested :post, format_action_url(@call, "playback_start")
89
89
  @call.playback_stop
90
- assert_requested :post, format_url(@call, "playback_stop")
90
+ assert_requested :post, format_action_url(@call, "playback_stop")
91
91
  @call.send_dtmf digits: "1www2WABCDw9"
92
- assert_requested :post, format_url(@call, "send_dtmf")
92
+ assert_requested :post, format_action_url(@call, "send_dtmf")
93
93
  @call.transfer to: "+15552223333"
94
- assert_requested :post, format_url(@call, "transfer")
94
+ assert_requested :post, format_action_url(@call, "transfer")
95
95
  end
96
96
  end
97
97
 
98
98
  context "commands" do
99
99
  should "reject" do
100
- @call.reject
101
- assert_requested :post, format_url(@call, "reject")
100
+ @call.reject cause: "CALL_REJECTED"
101
+ assert_requested :post, format_action_url(@call, "reject")
102
102
  end
103
103
  should "answer" do
104
104
  @call.answer
105
- assert_requested :post, format_url(@call, "answer")
105
+ assert_requested :post, format_action_url(@call, "answer")
106
106
  end
107
107
  should "hangup" do
108
108
  @call.hangup
109
- assert_requested :post, format_url(@call, "hangup")
109
+ assert_requested :post, format_action_url(@call, "hangup")
110
110
  end
111
111
  should "bridge" do
112
112
  @call.bridge call_control_id: SecureRandom.base64(20)
113
- assert_requested :post, format_url(@call, "bridge")
113
+ assert_requested :post, format_action_url(@call, "bridge")
114
114
  end
115
115
  should "speak" do
116
116
  @call.speak language: "en-US", voice: "female", payload: "Telnyx call control test"
117
- assert_requested :post, format_url(@call, "speak")
117
+ assert_requested :post, format_action_url(@call, "speak")
118
118
  end
119
119
  should "start fork" do
120
120
  @call.fork_start call_control_id: SecureRandom.base64(20)
121
- assert_requested :post, format_url(@call, "fork_start")
121
+ assert_requested :post, format_action_url(@call, "fork_start")
122
122
  end
123
123
  should "stop fork" do
124
124
  @call.fork_stop
125
- assert_requested :post, format_url(@call, "fork_stop")
125
+ assert_requested :post, format_action_url(@call, "fork_stop")
126
126
  end
127
127
  should "gather using audio" do
128
128
  @call.gather_using_audio audio_url: "https://audio.example.com"
129
- assert_requested :post, format_url(@call, "gather_using_audio")
129
+ assert_requested :post, format_action_url(@call, "gather_using_audio")
130
130
  end
131
131
  should "gather using speak" do
132
132
  @call.gather_using_speak language: "en-US", voice: "female", payload: "Telnyx call control test"
133
- assert_requested :post, format_url(@call, "gather_using_speak")
133
+ assert_requested :post, format_action_url(@call, "gather_using_speak")
134
134
  end
135
135
  should "playback start" do
136
136
  @call.playback_start audio_url: "https://audio.example.com"
137
- assert_requested :post, format_url(@call, "playback_start")
137
+ assert_requested :post, format_action_url(@call, "playback_start")
138
138
  end
139
139
  should "playback stop" do
140
140
  @call.playback_stop
141
- assert_requested :post, format_url(@call, "playback_stop")
141
+ assert_requested :post, format_action_url(@call, "playback_stop")
142
142
  end
143
143
  should "send dtmf" do
144
144
  @call.send_dtmf digits: "1www2WABCDw9"
145
- assert_requested :post, format_url(@call, "send_dtmf")
145
+ assert_requested :post, format_action_url(@call, "send_dtmf")
146
146
  end
147
147
  should "transfer" do
148
148
  @call.transfer to: "+15552223333"
149
- assert_requested :post, format_url(@call, "transfer")
149
+ assert_requested :post, format_action_url(@call, "transfer")
150
+ end
151
+ should "start transcription" do
152
+ @call.transcription_start
153
+ assert_requested :post, format_action_url(@call, "transcription_start")
154
+ end
155
+ should "end transcription" do
156
+ @call.transcription_stop
157
+ assert_requested :post, format_action_url(@call, "transcription_stop")
158
+ end
159
+ should "pause recording" do
160
+ @call.record_pause
161
+ assert_requested :post, format_action_url(@call, "record_pause")
162
+ end
163
+ should "resume recording" do
164
+ @call.record_resume
165
+ assert_requested :post, format_action_url(@call, "record_resume")
166
+ end
167
+ should "gather stop" do
168
+ @call.gather_stop
169
+ assert_requested :post, format_action_url(@call, "gather_stop")
170
+ end
171
+ should "refer" do
172
+ @call.refer sip_address: "sip:username@sip.non-telnyx-address.com"
173
+ assert_requested :post, format_action_url(@call, "refer")
150
174
  end
151
175
  end
152
176
 
153
177
  def create_call
154
- Telnyx::Call.create connection_id: "12345", to: "+15550001111", from: "+15550002222"
178
+ Telnyx::Call.create connection_id: "12345", to: "+15550001111", from: "+15550002222", cause: "test"
155
179
  end
156
180
 
157
- def format_url(call, action)
181
+ def format_action_url(call, action)
158
182
  "#{Telnyx.api_base}/v2/calls/#{call.call_control_id}/actions/#{action}"
159
183
  end
160
184
  end
@@ -5,14 +5,19 @@ require_relative "../test_helper"
5
5
  module Telnyx
6
6
  class ConferenceTest < Test::Unit::TestCase
7
7
  setup do
8
- @call = create_call
9
- @conference = Conference.create call_control_id: @call.id, name: "conference!"
8
+ @conference = Conference.create call_control_id: "foobar", name: "conference!"
10
9
  end
11
10
  should "create conference" do
12
11
  assert_requested :post, "#{Telnyx.api_base}/v2/conferences"
13
12
  assert_kind_of Conference, @conference
14
13
  end
15
14
 
15
+ should "retrieve conference" do
16
+ conference = Conference.retrieve "foobar"
17
+ assert_kind_of Conference, conference
18
+ assert_requested :get, "#{Telnyx.api_base}/v2/conferences/foobar"
19
+ end
20
+
16
21
  should "list conferences" do
17
22
  conferences = Conference.list
18
23
 
@@ -21,47 +26,79 @@ module Telnyx
21
26
  assert_kind_of Conference, conferences.first
22
27
  end
23
28
 
29
+ should "list participants" do
30
+ participants = @conference.participants
31
+ assert_requested :get, "#{Telnyx.api_base}/v2/conferences/#{@conference.id}/participants"
32
+ assert_kind_of ListObject, participants
33
+ end
34
+
24
35
  should "have nested command instance methods" do
25
36
  assert defined? @conference.join
26
37
  assert defined? @conference.mute
27
38
  assert defined? @conference.unmute
28
39
  assert defined? @conference.unhold
40
+ assert defined? @conference.play
41
+ assert defined? @conference.start_recording
42
+ assert defined? @conference.stop_recording
43
+ assert defined? @conference.speak
44
+ assert defined? @conference.dial_participant
45
+ assert defined? @conference.update
29
46
  end
30
47
 
31
48
  context "commands" do
32
49
  should "join" do
33
- stub = stub_request(:post, format_url(@conference, "join"))
34
- .to_return(body: JSON.generate(result: "ok"))
35
- @conference.join
36
- assert_requested stub
50
+ @conference.join call_control_id: "foo_bar_baz"
51
+ assert_requested :post, action_url(@conference, "join")
37
52
  end
38
53
 
39
54
  should "mute" do
40
- stub = stub_request(:post, format_url(@conference, "mute"))
41
- .to_return(body: JSON.generate(result: "ok"))
42
55
  @conference.mute
43
- assert_requested stub
56
+ assert_requested :post, action_url(@conference, "mute")
44
57
  end
45
58
 
46
59
  should "unmute" do
47
- stub = stub_request(:post, format_url(@conference, "unmute"))
48
- .to_return(body: JSON.generate(result: "ok"))
49
60
  @conference.unmute
50
- assert_requested stub
61
+ assert_requested :post, action_url(@conference, "unmute")
51
62
  end
52
63
 
53
64
  should "hold" do
54
- stub = stub_request(:post, format_url(@conference, "hold"))
55
- .to_return(body: JSON.generate(result: "ok"))
56
65
  @conference.hold
57
- assert_requested stub
66
+ assert_requested :post, action_url(@conference, "hold")
58
67
  end
59
68
 
60
69
  should "unhold" do
61
- stub = stub_request(:post, format_url(@conference, "unhold"))
62
- .to_return(body: JSON.generate(result: "ok"))
63
- @conference.unhold
64
- assert_requested stub
70
+ @conference.unhold call_control_ids: %w[foo bar baz]
71
+ assert_requested :post, action_url(@conference, "unhold")
72
+ end
73
+
74
+ should "play" do
75
+ @conference.play audio_url: "https://example.com/audio.mp3"
76
+ assert_requested :post, action_url(@conference, "play")
77
+ end
78
+
79
+ should "start recording" do
80
+ @conference.start_recording channels: "dual", format: "mp3"
81
+ assert_requested :post, action_url(@conference, "record_start")
82
+ end
83
+
84
+ should "stop recording" do
85
+ @conference.stop_recording
86
+ assert_requested :post, action_url(@conference, "record_stop")
87
+ end
88
+
89
+ should "speak" do
90
+ @conference.speak language: "en-US", payload: "test speech", voice: "female"
91
+ assert_requested :post, action_url(@conference, "speak")
92
+ end
93
+
94
+ should "dial participant" do
95
+ @conference.dial_participant call_control_id: "foo", to: "+12223334444", from: "+12223335555"
96
+ assert_requested :post, action_url(@conference, "dial_participant")
97
+ end
98
+
99
+ should "update" do
100
+ @conference.update call_control_id: "foo"
101
+ assert_requested :post, action_url(@conference, "update")
65
102
  end
66
103
  end
67
104
 
@@ -69,7 +106,7 @@ module Telnyx
69
106
  Telnyx::Call.create connection_id: "12345", to: "+15550001111", from: "+15550002222"
70
107
  end
71
108
 
72
- def format_url(conf, action)
109
+ def action_url(conf, action)
73
110
  "#{Telnyx.api_base}/v2/conferences/#{conf.id}/actions/#{action}"
74
111
  end
75
112
  end