bandwidth-sdk 18.3.0 → 19.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +27 -21
- data/README.md +2 -11
- data/Rakefile +1 -1
- data/bandwidth.yml +341 -122
- data/coverage/.last_run.json +1 -1
- data/coverage/.resultset.json +1308 -939
- data/coverage/index.html +21197 -17030
- data/custom_templates/README.mustache +1 -1
- data/custom_templates/api_client.mustache +3 -1
- data/custom_templates/configuration.mustache +18 -12
- data/custom_templates/gem.mustache +4 -2
- data/docs/Callback.md +1 -0
- data/docs/CallsApi.md +5 -25
- data/docs/ConferencesApi.md +9 -45
- data/docs/DisconnectCallback.md +6 -2
- data/docs/EndpointsApi.md +5 -25
- data/docs/InboundCallback.md +1 -1
- data/docs/InboundCallbackMessage.md +2 -0
- data/docs/InitiateCallback.md +1 -1
- data/docs/LookupResult.md +2 -2
- data/docs/MFAApi.md +3 -15
- data/docs/MediaApi.md +7 -23
- data/docs/Message.md +1 -1
- data/docs/MessagesApi.md +2 -10
- data/docs/MultiChannelAction.md +3 -3
- data/docs/MultiChannelActionCalendarEvent.md +3 -3
- data/docs/MultiChannelApi.md +1 -5
- data/docs/PhoneNumberLookupApi.md +3 -15
- data/docs/RbmActionBase.md +3 -3
- data/docs/RbmActionDial.md +3 -3
- data/docs/RbmActionOpenUrl.md +3 -3
- data/docs/RbmActionViewLocation.md +3 -3
- data/docs/RbmSession.md +26 -0
- data/docs/RbmSuggestionResponse.md +4 -4
- data/docs/RecordingsApi.md +10 -50
- data/docs/StatisticsApi.md +1 -5
- data/docs/StatusCallback.md +2 -2
- data/docs/StatusCallbackMessage.md +3 -1
- data/docs/TfvSubmissionInfo.md +2 -2
- data/docs/TollFreeVerificationApi.md +12 -48
- data/docs/TranscriptionsApi.md +3 -15
- data/docs/TransferDisconnectCallback.md +7 -1
- data/docs/VerificationRequest.md +2 -2
- data/docs/VerificationUpdateRequest.md +3 -3
- data/generate.sh +9 -0
- data/lib/bandwidth-sdk/api/calls_api.rb +5 -5
- data/lib/bandwidth-sdk/api/conferences_api.rb +9 -9
- data/lib/bandwidth-sdk/api/endpoints_api.rb +5 -5
- data/lib/bandwidth-sdk/api/media_api.rb +8 -8
- data/lib/bandwidth-sdk/api/messages_api.rb +2 -2
- data/lib/bandwidth-sdk/api/mfa_api.rb +3 -3
- data/lib/bandwidth-sdk/api/multi_channel_api.rb +1 -1
- data/lib/bandwidth-sdk/api/phone_number_lookup_api.rb +3 -3
- data/lib/bandwidth-sdk/api/recordings_api.rb +10 -10
- data/lib/bandwidth-sdk/api/statistics_api.rb +1 -1
- data/lib/bandwidth-sdk/api/toll_free_verification_api.rb +15 -15
- data/lib/bandwidth-sdk/api/transcriptions_api.rb +3 -3
- data/lib/bandwidth-sdk/api_client.rb +3 -1
- data/lib/bandwidth-sdk/configuration.rb +18 -19
- data/lib/bandwidth-sdk/models/callback.rb +1 -0
- data/lib/bandwidth-sdk/models/disconnect_callback.rb +27 -5
- data/lib/bandwidth-sdk/models/inbound_callback_message.rb +10 -1
- data/lib/bandwidth-sdk/models/initiate_callback.rb +1 -1
- data/lib/bandwidth-sdk/models/list_message_item.rb +1 -0
- data/lib/bandwidth-sdk/models/multi_channel_action_calendar_event.rb +1 -1
- data/lib/bandwidth-sdk/models/rbm_action_base.rb +1 -1
- data/lib/bandwidth-sdk/models/rbm_action_dial.rb +1 -1
- data/lib/bandwidth-sdk/models/rbm_action_open_url.rb +1 -1
- data/lib/bandwidth-sdk/models/rbm_action_view_location.rb +1 -1
- data/lib/bandwidth-sdk/models/rbm_session.rb +208 -0
- data/lib/bandwidth-sdk/models/rbm_suggestion_response.rb +2 -2
- data/lib/bandwidth-sdk/models/status_callback_message.rb +13 -4
- data/lib/bandwidth-sdk/models/status_callback_type_enum.rb +2 -1
- data/lib/bandwidth-sdk/models/tfv_submission_info.rb +2 -2
- data/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb +37 -5
- data/lib/bandwidth-sdk/models/verification_request.rb +2 -2
- data/lib/bandwidth-sdk/models/verification_update_request.rb +19 -2
- data/lib/bandwidth-sdk/version.rb +1 -1
- data/lib/bandwidth-sdk.rb +3 -2
- data/spec/smoke/calls_api_spec.rb +46 -46
- data/spec/smoke/conferences_api_spec.rb +1 -1
- data/spec/smoke/endpoints_api_spec.rb +2 -31
- data/spec/smoke/media_api_spec.rb +2 -0
- data/spec/smoke/messages_api_spec.rb +2 -24
- data/spec/smoke/mfa_api_spec.rb +4 -27
- data/spec/smoke/multi_channel_api_spec.rb +4 -2
- data/spec/smoke/phone_number_lookup_api_spec.rb +2 -0
- data/spec/smoke/recordings_api_spec.rb +1 -1
- data/spec/smoke/smoke_helper.rb +41 -0
- data/spec/smoke/statistics_api_spec.rb +2 -37
- data/spec/smoke/toll_free_verification_api_spec.rb +2 -0
- data/spec/smoke/transcriptions_api_spec.rb +1 -1
- data/spec/spec_helper.rb +0 -48
- data/spec/unit/api/calls_api_spec.rb +3 -1
- data/spec/unit/api/conferences_api_spec.rb +2 -0
- data/spec/unit/api/endpoints_api_spec.rb +2 -0
- data/spec/unit/api/media_api_spec.rb +2 -0
- data/spec/unit/api/messages_api_spec.rb +2 -0
- data/spec/unit/api/mfa_api_spec.rb +2 -0
- data/spec/unit/api/multi_channel_api_spec.rb +2 -0
- data/spec/unit/api/phone_number_lookup_api_spec.rb +2 -0
- data/spec/unit/api/recordings_api_spec.rb +2 -0
- data/spec/unit/api/statistics_api_spec.rb +2 -0
- data/spec/unit/api/toll_free_verification_api_spec.rb +2 -0
- data/spec/unit/api/transcriptions_api_spec.rb +2 -0
- data/spec/unit/client/api_client_spec.rb +70 -206
- data/spec/unit/client/configuration_spec.rb +22 -17
- data/spec/unit/constants.rb +6 -0
- data/spec/unit/models/callback_spec.rb +1 -0
- data/spec/unit/models/disconnect_callback_spec.rb +10 -2
- data/spec/unit/models/inbound_callback_message_spec.rb +20 -5
- data/spec/unit/models/list_message_item_spec.rb +1 -0
- data/spec/unit/models/rbm_session_spec.rb +95 -0
- data/spec/unit/models/status_callback_message_spec.rb +20 -5
- data/spec/unit/models/status_callback_type_enum_spec.rb +7 -1
- data/spec/unit/models/tfv_submission_wrapper_spec.rb +2 -1
- data/spec/unit/models/transfer_disconnect_callback_spec.rb +16 -4
- data/spec/unit/models/verification_update_request_spec.rb +4 -2
- metadata +10 -1
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
require_relative 'smoke_helper'
|
|
2
|
+
|
|
1
3
|
# Integration Tests for Bandwidth::EndpointsApi
|
|
2
4
|
describe 'EndpointsApi Integration Tests' do
|
|
3
5
|
before(:all) do
|
|
@@ -9,14 +11,6 @@ describe 'EndpointsApi Integration Tests' do
|
|
|
9
11
|
client = Bandwidth::ApiClient.new(config)
|
|
10
12
|
@endpoints_api_instance = Bandwidth::EndpointsApi.new(client)
|
|
11
13
|
|
|
12
|
-
unauthorized_config = Bandwidth::Configuration.new
|
|
13
|
-
unauthorized_config.configure do |config|
|
|
14
|
-
config.username = UNAUTHORIZED_USERNAME
|
|
15
|
-
config.password = UNAUTHORIZED_PASSWORD
|
|
16
|
-
end
|
|
17
|
-
unauthorized_client = Bandwidth::ApiClient.new(unauthorized_config)
|
|
18
|
-
@unauthorized_api_instance = Bandwidth::EndpointsApi.new(unauthorized_client)
|
|
19
|
-
|
|
20
14
|
$endpoint_id = ''
|
|
21
15
|
end
|
|
22
16
|
|
|
@@ -104,29 +98,6 @@ describe 'EndpointsApi Integration Tests' do
|
|
|
104
98
|
|
|
105
99
|
# HTTP 4XX Errors
|
|
106
100
|
describe 'http error' do
|
|
107
|
-
it 'causes a 401 error on create' do
|
|
108
|
-
create_endpoint_body = Bandwidth::CreateWebRtcConnectionRequest.new(
|
|
109
|
-
type: Bandwidth::EndpointTypeEnum::WEBRTC,
|
|
110
|
-
direction: Bandwidth::EndpointDirectionEnum::BIDIRECTIONAL
|
|
111
|
-
)
|
|
112
|
-
|
|
113
|
-
expect {
|
|
114
|
-
@unauthorized_api_instance.create_endpoint_with_http_info(BW_ACCOUNT_ID, create_endpoint_body)
|
|
115
|
-
}.to raise_error { |e|
|
|
116
|
-
expect(e).to be_instance_of(Bandwidth::ApiError)
|
|
117
|
-
expect(e.code).to eq(401)
|
|
118
|
-
}
|
|
119
|
-
end
|
|
120
|
-
|
|
121
|
-
it 'causes a 401 error on list' do
|
|
122
|
-
expect {
|
|
123
|
-
@unauthorized_api_instance.list_endpoints_with_http_info(BW_ACCOUNT_ID)
|
|
124
|
-
}.to raise_error { |e|
|
|
125
|
-
expect(e).to be_instance_of(Bandwidth::ApiError)
|
|
126
|
-
expect(e.code).to eq(401)
|
|
127
|
-
}
|
|
128
|
-
end
|
|
129
|
-
|
|
130
101
|
it 'causes a 404 error on get' do
|
|
131
102
|
expect {
|
|
132
103
|
@endpoints_api_instance.get_endpoint_with_http_info(BW_ACCOUNT_ID, 'does-not-exist')
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
require_relative 'smoke_helper'
|
|
2
|
+
|
|
1
3
|
# Integration Tests for Bandwidth::MessagesApi
|
|
2
4
|
describe 'MessagesApi Integration Tests' do
|
|
3
5
|
# message info
|
|
@@ -110,30 +112,6 @@ describe 'MessagesApi Integration Tests' do
|
|
|
110
112
|
expect(e.code).to eq(400)
|
|
111
113
|
}
|
|
112
114
|
end
|
|
113
|
-
|
|
114
|
-
it 'causes a 401 error' do
|
|
115
|
-
config = Bandwidth::Configuration.new
|
|
116
|
-
config.configure do |config|
|
|
117
|
-
config.username = UNAUTHORIZED_USERNAME
|
|
118
|
-
config.password = UNAUTHORIZED_PASSWORD
|
|
119
|
-
end
|
|
120
|
-
client = Bandwidth::ApiClient.new(config)
|
|
121
|
-
unauthorized_instance = Bandwidth::MessagesApi.new(client)
|
|
122
|
-
|
|
123
|
-
body = Bandwidth::MessageRequest.new(
|
|
124
|
-
application_id: BW_MESSAGING_APPLICATION_ID,
|
|
125
|
-
to: [USER_NUMBER],
|
|
126
|
-
from: BW_NUMBER,
|
|
127
|
-
text: 'ruby sdk 401 test'
|
|
128
|
-
)
|
|
129
|
-
|
|
130
|
-
expect {
|
|
131
|
-
unauthorized_instance.create_message_with_http_info(BW_ACCOUNT_ID, body)
|
|
132
|
-
}.to raise_error { |e|
|
|
133
|
-
expect(e).to be_instance_of(Bandwidth::ApiError)
|
|
134
|
-
expect(e.code).to eq(401)
|
|
135
|
-
}
|
|
136
|
-
end
|
|
137
115
|
end
|
|
138
116
|
|
|
139
117
|
end
|
data/spec/smoke/mfa_api_spec.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
require_relative 'smoke_helper'
|
|
2
|
+
|
|
1
3
|
# Integration Tests for Bandwidth::MFAApi
|
|
2
4
|
describe 'MFAApi Integration Tests' do
|
|
3
5
|
# mfa info
|
|
@@ -7,8 +9,8 @@ describe 'MFAApi Integration Tests' do
|
|
|
7
9
|
before(:all) do
|
|
8
10
|
config = Bandwidth::Configuration.new
|
|
9
11
|
config.configure do |config|
|
|
10
|
-
config.
|
|
11
|
-
config.
|
|
12
|
+
config.client_id = BW_CLIENT_ID
|
|
13
|
+
config.client_secret = BW_CLIENT_SECRET
|
|
12
14
|
end
|
|
13
15
|
client = Bandwidth::ApiClient.new(config)
|
|
14
16
|
@mfa_api_instance = Bandwidth::MFAApi.new(client)
|
|
@@ -88,30 +90,5 @@ describe 'MFAApi Integration Tests' do
|
|
|
88
90
|
expect(e.code).to eq(400)
|
|
89
91
|
}
|
|
90
92
|
end
|
|
91
|
-
|
|
92
|
-
it 'causes a 403 error' do
|
|
93
|
-
config = Bandwidth::Configuration.new
|
|
94
|
-
config.configure do |config|
|
|
95
|
-
config.username = UNAUTHORIZED_USERNAME
|
|
96
|
-
config.password = UNAUTHORIZED_PASSWORD
|
|
97
|
-
end
|
|
98
|
-
client = Bandwidth::ApiClient.new(config)
|
|
99
|
-
forbidden_instance = Bandwidth::MFAApi.new(client)
|
|
100
|
-
|
|
101
|
-
req_schema = Bandwidth::CodeRequest.new(
|
|
102
|
-
to: USER_NUMBER,
|
|
103
|
-
from: BW_NUMBER,
|
|
104
|
-
application_id: BW_MESSAGING_APPLICATION_ID,
|
|
105
|
-
message: message,
|
|
106
|
-
digits: digits
|
|
107
|
-
)
|
|
108
|
-
|
|
109
|
-
expect {
|
|
110
|
-
forbidden_instance.generate_messaging_code_with_http_info(BW_ACCOUNT_ID, req_schema)
|
|
111
|
-
}.to raise_error { |e|
|
|
112
|
-
expect(e).to be_instance_of(Bandwidth::ApiError)
|
|
113
|
-
expect(e.code).to eq(403)
|
|
114
|
-
}
|
|
115
|
-
end
|
|
116
93
|
end
|
|
117
94
|
end
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
require_relative 'smoke_helper'
|
|
2
|
+
|
|
1
3
|
# Integration tests for Bandwidth::MultiChannelApi
|
|
2
4
|
describe 'MultiChannelApi' do
|
|
3
5
|
before(:all) do
|
|
4
6
|
config = Bandwidth::Configuration.new
|
|
5
7
|
config.configure do |config|
|
|
6
|
-
config.
|
|
7
|
-
config.
|
|
8
|
+
config.client_id = BW_CLIENT_ID
|
|
9
|
+
config.client_secret = BW_CLIENT_SECRET
|
|
8
10
|
end
|
|
9
11
|
client = Bandwidth::ApiClient.new(config)
|
|
10
12
|
@multi_channel_api_instance = Bandwidth::MultiChannelApi.new(client)
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
require_relative '../call_utils'
|
|
2
|
+
|
|
3
|
+
RSpec.configure do |config|
|
|
4
|
+
config.before(:suite) {
|
|
5
|
+
begin
|
|
6
|
+
BW_CLIENT_ID = ENV.fetch('BW_CLIENT_ID')
|
|
7
|
+
BW_CLIENT_SECRET = ENV.fetch('BW_CLIENT_SECRET')
|
|
8
|
+
BW_ACCOUNT_ID = ENV.fetch('BW_ACCOUNT_ID')
|
|
9
|
+
BW_VOICE_APPLICATION_ID = ENV.fetch('BW_VOICE_APPLICATION_ID')
|
|
10
|
+
BW_MESSAGING_APPLICATION_ID = ENV.fetch('BW_MESSAGING_APPLICATION_ID')
|
|
11
|
+
BASE_CALLBACK_URL = ENV.fetch('BASE_CALLBACK_URL')
|
|
12
|
+
BW_NUMBER = ENV.fetch('BW_NUMBER')
|
|
13
|
+
USER_NUMBER = ENV.fetch('USER_NUMBER')
|
|
14
|
+
MANTECA_ACTIVE_NUMBER = ENV.fetch('MANTECA_ACTIVE_NUMBER')
|
|
15
|
+
MANTECA_IDLE_NUMBER = ENV.fetch('MANTECA_IDLE_NUMBER')
|
|
16
|
+
MANTECA_BASE_URL = ENV.fetch('MANTECA_BASE_URL')
|
|
17
|
+
MANTECA_APPLICATION_ID = ENV.fetch('MANTECA_APPLICATION_ID')
|
|
18
|
+
OPERATING_SYSTEM = ENV.fetch('OPERATING_SYSTEM')
|
|
19
|
+
rescue
|
|
20
|
+
puts 'Environmental variables not found'
|
|
21
|
+
exit(-1)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
SLEEP_TIME_S = 3 # default sleep time in seconds
|
|
25
|
+
MAX_RETRIES = 40
|
|
26
|
+
$active_calls = []
|
|
27
|
+
|
|
28
|
+
$complete_call_body = Bandwidth::UpdateCall.new(
|
|
29
|
+
state: Bandwidth::CallStateEnum::COMPLETED
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
config.after(:suite) {
|
|
34
|
+
Bandwidth.configure do |config|
|
|
35
|
+
config.client_id = BW_CLIENT_ID
|
|
36
|
+
config.client_secret = BW_CLIENT_SECRET
|
|
37
|
+
end
|
|
38
|
+
calls_api = Bandwidth::CallsApi.new
|
|
39
|
+
cleanup_calls($active_calls, calls_api)
|
|
40
|
+
}
|
|
41
|
+
end
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
require_relative 'smoke_helper'
|
|
2
|
+
|
|
1
3
|
# Integration Tests for Bandwidth::StatisticsApi
|
|
2
4
|
describe 'StatisticsApi Integration Tests' do
|
|
3
5
|
before(:all) do
|
|
@@ -21,41 +23,4 @@ describe 'StatisticsApi Integration Tests' do
|
|
|
21
23
|
expect(data.max_call_queue_size).to eq(7500)
|
|
22
24
|
end
|
|
23
25
|
end
|
|
24
|
-
|
|
25
|
-
# HTTP 4XX Errors
|
|
26
|
-
describe 'http error' do
|
|
27
|
-
it 'causes a 401 error' do
|
|
28
|
-
config = Bandwidth::Configuration.new
|
|
29
|
-
config.configure do |config|
|
|
30
|
-
config.username = UNAUTHORIZED_USERNAME
|
|
31
|
-
config.password = UNAUTHORIZED_PASSWORD
|
|
32
|
-
end
|
|
33
|
-
client = Bandwidth::ApiClient.new(config)
|
|
34
|
-
unauthorized_instance = Bandwidth::StatisticsApi.new(client)
|
|
35
|
-
|
|
36
|
-
expect {
|
|
37
|
-
unauthorized_instance.get_statistics_with_http_info(BW_ACCOUNT_ID)
|
|
38
|
-
}.to raise_error { |e|
|
|
39
|
-
expect(e).to be_instance_of(Bandwidth::ApiError)
|
|
40
|
-
expect(e.code).to eq(401)
|
|
41
|
-
}
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
it 'causes a 403 error' do
|
|
45
|
-
config = Bandwidth::Configuration.new
|
|
46
|
-
config.configure do |config|
|
|
47
|
-
config.username = FORBIDDEN_USERNAME
|
|
48
|
-
config.password = FORBIDDEN_PASSWORD
|
|
49
|
-
end
|
|
50
|
-
client = Bandwidth::ApiClient.new(config)
|
|
51
|
-
forbidden_instance = Bandwidth::StatisticsApi.new(client)
|
|
52
|
-
|
|
53
|
-
expect {
|
|
54
|
-
forbidden_instance.get_statistics_with_http_info(BW_ACCOUNT_ID)
|
|
55
|
-
}.to raise_error { |e|
|
|
56
|
-
expect(e).to be_instance_of(Bandwidth::ApiError)
|
|
57
|
-
expect(e.code).to eq(403)
|
|
58
|
-
}
|
|
59
|
-
end
|
|
60
|
-
end
|
|
61
26
|
end
|
data/spec/spec_helper.rb
CHANGED
|
@@ -19,9 +19,6 @@ end
|
|
|
19
19
|
# load the gem
|
|
20
20
|
require 'bandwidth-sdk'
|
|
21
21
|
|
|
22
|
-
# load call utils every time. This prevents an error from occurring when running only unit tests
|
|
23
|
-
require_relative './call_utils'
|
|
24
|
-
|
|
25
22
|
# The following was generated by the `rspec --init` command. Conventionally, all
|
|
26
23
|
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
|
27
24
|
# The generated `.rspec` file contains `--require spec_helper` which will cause
|
|
@@ -41,51 +38,6 @@ require_relative './call_utils'
|
|
|
41
38
|
#
|
|
42
39
|
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
|
43
40
|
RSpec.configure do |config|
|
|
44
|
-
config.before(:suite) {
|
|
45
|
-
begin
|
|
46
|
-
BW_USERNAME = ENV.fetch('BW_USERNAME')
|
|
47
|
-
BW_PASSWORD = ENV.fetch('BW_PASSWORD')
|
|
48
|
-
BW_CLIENT_ID = ENV.fetch('BW_CLIENT_ID')
|
|
49
|
-
BW_CLIENT_SECRET = ENV.fetch('BW_CLIENT_SECRET')
|
|
50
|
-
FORBIDDEN_USERNAME = ENV.fetch('BW_USERNAME_FORBIDDEN')
|
|
51
|
-
FORBIDDEN_PASSWORD = ENV.fetch('BW_PASSWORD_FORBIDDEN')
|
|
52
|
-
BW_ACCOUNT_ID = ENV.fetch('BW_ACCOUNT_ID')
|
|
53
|
-
BW_VOICE_APPLICATION_ID = ENV.fetch('BW_VOICE_APPLICATION_ID')
|
|
54
|
-
BW_MESSAGING_APPLICATION_ID = ENV.fetch('BW_MESSAGING_APPLICATION_ID')
|
|
55
|
-
BASE_CALLBACK_URL = ENV.fetch('BASE_CALLBACK_URL')
|
|
56
|
-
BW_NUMBER = ENV.fetch('BW_NUMBER')
|
|
57
|
-
USER_NUMBER = ENV.fetch('USER_NUMBER')
|
|
58
|
-
MANTECA_ACTIVE_NUMBER = ENV.fetch('MANTECA_ACTIVE_NUMBER')
|
|
59
|
-
MANTECA_IDLE_NUMBER = ENV.fetch('MANTECA_IDLE_NUMBER')
|
|
60
|
-
MANTECA_BASE_URL = ENV.fetch('MANTECA_BASE_URL')
|
|
61
|
-
MANTECA_APPLICATION_ID = ENV.fetch('MANTECA_APPLICATION_ID')
|
|
62
|
-
OPERATING_SYSTEM = ENV.fetch('OPERATING_SYSTEM')
|
|
63
|
-
RUBY_VERSION = ENV.fetch('RUBY_VERSION')
|
|
64
|
-
rescue
|
|
65
|
-
puts 'Environmental variables not found'
|
|
66
|
-
exit(-1)
|
|
67
|
-
end
|
|
68
|
-
|
|
69
|
-
SLEEP_TIME_S = 3 # default sleep time in seconds
|
|
70
|
-
MAX_RETRIES = 40
|
|
71
|
-
UNAUTHORIZED_USERNAME = 'bad_username'
|
|
72
|
-
UNAUTHORIZED_PASSWORD = 'bad_password'
|
|
73
|
-
$active_calls = []
|
|
74
|
-
|
|
75
|
-
$complete_call_body = Bandwidth::UpdateCall.new(
|
|
76
|
-
state: Bandwidth::CallStateEnum::COMPLETED
|
|
77
|
-
)
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
config.after(:suite) {
|
|
81
|
-
Bandwidth.configure do |config|
|
|
82
|
-
config.username = BW_USERNAME
|
|
83
|
-
config.password = BW_PASSWORD
|
|
84
|
-
end
|
|
85
|
-
calls_api = Bandwidth::CallsApi.new
|
|
86
|
-
cleanup_calls($active_calls, calls_api)
|
|
87
|
-
}
|
|
88
|
-
|
|
89
41
|
RSpec::Matchers.define(:be_one_of) do |expected|
|
|
90
42
|
match do |actual|
|
|
91
43
|
expected.include?(actual)
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
require_relative '../constants'
|
|
2
|
+
|
|
1
3
|
# Unit tests for Bandwidth::CallsApi
|
|
2
4
|
describe 'CallsApi' do
|
|
3
5
|
let(:call_id) { 'c-1234' }
|
|
@@ -174,7 +176,7 @@ describe 'CallsApi' do
|
|
|
174
176
|
it 'creates and updates a call' do
|
|
175
177
|
update_call_body = Bandwidth::UpdateCall.new(
|
|
176
178
|
state: Bandwidth::CallStateEnum::ACTIVE,
|
|
177
|
-
redirect_url:
|
|
179
|
+
redirect_url: BASE_CALLBACK_URL + '/bxml/pause'
|
|
178
180
|
)
|
|
179
181
|
|
|
180
182
|
_data, status_code = @calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, call_id, update_call_body)
|