ruby-bandwidth-iris 2.7.2 → 3.0.0.pre

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,90 +0,0 @@
1
- describe BandwidthIris::Applications do
2
- client = nil
3
-
4
- before :each do
5
- client = Helper.get_client()
6
- end
7
-
8
- after :each do
9
- client.stubs.verify_stubbed_calls()
10
- end
11
-
12
- describe '#get' do
13
- it 'should get applications' do
14
- client.stubs.get("/v1.0/accounts/accountId/applications", ){|env| [200, {}, Helper.xml['applicationList']]}
15
- applications = Applications.get_applications(client)
16
- expect(applications[0][:application_id]).to eql("d1")
17
- expect(applications[1][:application_id]).to eql("d2")
18
- end
19
-
20
- it 'should get applications with one item' do
21
- client.stubs.get("/v1.0/accounts/accountId/applications", ){|env| [200, {}, Helper.xml['applicationListOne']]}
22
- applications = Applications.get_applications(client)
23
- expect(applications[0][:application_id]).to eql("d1")
24
- end
25
-
26
- it 'should get an application' do
27
- client.stubs.get("/v1.0/accounts/accountId/applications/id", ){|env| [200, {}, Helper.xml['application']]}
28
- application = Applications.get_application(client, "id")
29
- expect(application[:application_id]).to eql("d1")
30
- end
31
-
32
- it 'should get an application\'s sippeers' do
33
- client.stubs.get("/v1.0/accounts/accountId/applications/id/associatedsippeers", ){|env| [200, {}, Helper.xml['applicationSippeers']]}
34
- sippeers = Applications.get_application_sippeers(client, "id")
35
- expect(sippeers[0][:site_id]).to eql(1)
36
- expect(sippeers[1][:site_id]).to eql(2)
37
- end
38
-
39
- it 'should get an application\'s sippeers with one item' do
40
- client.stubs.get("/v1.0/accounts/accountId/applications/id/associatedsippeers", ){|env| [200, {}, Helper.xml['applicationSippeersOne']]}
41
- sippeers = Applications.get_application_sippeers(client, "id")
42
- expect(sippeers[0][:site_id]).to eql(1)
43
- end
44
- end
45
-
46
- describe '#create' do
47
- it' should create an application' do
48
- data = {
49
- :service_type => "Messaging-V2",
50
- :app_name => "Name",
51
- :msg_callback_url => "https://test.com"
52
- }
53
- client.stubs.post("/v1.0/accounts/accountId/applications", client.build_xml({:application => data})){|env| [200, {}, Helper.xml['application']]}
54
- application = Applications.create_application(client, data)
55
- expect(application[:application_id]).to eql("d1")
56
- end
57
- end
58
-
59
- describe '#update' do
60
- it 'should partial update an application' do
61
- data = {
62
- :service_type => "Messaging-V2",
63
- :app_name => "Name",
64
- :msg_callback_url => "https://test.com"
65
- }
66
- client.stubs.patch("/v1.0/accounts/accountId/applications/id", client.build_xml({:application => data})){|env| [200, {}, Helper.xml['application']]}
67
- application = Applications.partial_update_application(client, "id", data)
68
- expect(application[:application_id]).to eql("d1")
69
- end
70
-
71
- it 'should complete update an application' do
72
- data = {
73
- :service_type => "Messaging-V2",
74
- :app_name => "Name",
75
- :msg_callback_url => "https://test.com"
76
- }
77
- client.stubs.put("/v1.0/accounts/accountId/applications/id", client.build_xml({:application => data})){|env| [200, {}, Helper.xml['application']]}
78
- application = Applications.complete_update_application(client, "id", data)
79
- expect(application[:application_id]).to eql("d1")
80
- end
81
- end
82
-
83
- describe '#delete' do
84
- it 'should delete an application' do
85
- client.stubs.delete("/v1.0/accounts/accountId/applications/id"){|env| [200, {}, '']}
86
- Applications.delete_application(client, "id")
87
- end
88
- end
89
-
90
- end
@@ -1,35 +0,0 @@
1
- describe BandwidthIris::EmergencyNotificationEndpoints do
2
- client = nil
3
-
4
- before :each do
5
- client = Helper.get_client()
6
- end
7
-
8
- after :each do
9
- client.stubs.verify_stubbed_calls()
10
- end
11
-
12
- describe '#EneTests' do
13
- it 'should create ene order' do
14
- data = {
15
- :value => "value"
16
- }
17
- client.stubs.post("/v1.0/accounts/accountId/emergencyNotificationEndpointOrders", client.build_xml({:emergency_notification_endpoint_order => data})) {|env| [200, {}, Helper.xml['emergencyNotificationEndpointOrder']]}
18
- ene_order = EmergencyNotificationEndpoints.create_emergency_notification_endpoint_order(client, data)
19
- expect(ene_order[:order_id]).to eql("3e9a852e-2d1d-4e2d-84c3-87223a78cb70")
20
- end
21
-
22
- it 'should get ene orders' do
23
- client.stubs.get("/v1.0/accounts/accountId/emergencyNotificationEndpointOrders") {|env| [200, {}, Helper.xml['emergencyNotificationEndpointOrders']]}
24
- ene_orders = EmergencyNotificationEndpoints.get_emergency_notification_endpoint_orders(client)
25
- expect(ene_orders[:emergency_notification_endpoint_orders][:emergency_notification_endpoint_order][0][:order_id]).to eql("3e9a852e-2d1d-4e2d-84c3-87223a78cb70")
26
- end
27
-
28
- it 'should get ene order' do
29
- client.stubs.get("/v1.0/accounts/accountId/emergencyNotificationEndpointOrders/id") {|env| [200, {}, Helper.xml['emergencyNotificationEndpointOrder']]}
30
- ene_order = EmergencyNotificationEndpoints.get_emergency_notification_endpoint_order(client, "id")
31
- expect(ene_order[:order_id]).to eql("3e9a852e-2d1d-4e2d-84c3-87223a78cb70")
32
- end
33
- end
34
- end
35
-
@@ -1,48 +0,0 @@
1
- describe BandwidthIris::EmergencyNotificationGroups do
2
- client = nil
3
-
4
- before :each do
5
- client = Helper.get_client()
6
- end
7
-
8
- after :each do
9
- client.stubs.verify_stubbed_calls()
10
- end
11
-
12
- describe '#EngOrderTests' do
13
- it 'should create eng order' do
14
- data = {
15
- :value => "value"
16
- }
17
- client.stubs.post("/v1.0/accounts/accountId/emergencyNotificationGroupOrders", client.build_xml({:emergency_notification_group_order => data})) {|env| [200, {}, Helper.xml['emergencyNotificationGroupOrder']]}
18
- order = EmergencyNotificationGroups.create_emergency_notification_group_order(client, data)
19
- expect(order[:order_id]).to eql("900b3646-18df-4626-b237-3a8de648ebf6")
20
- end
21
-
22
- it 'should get eng orders' do
23
- client.stubs.get("/v1.0/accounts/accountId/emergencyNotificationGroupOrders") {|env| [200, {}, Helper.xml['emergencyNotificationGroupOrders']]}
24
- orders = EmergencyNotificationGroups.get_emergency_notification_group_orders(client)
25
- expect(orders[:emergency_notification_group_orders][:emergency_notification_group_order][0][:order_id]).to eql("092815dc-9ced-4d67-a070-a80eb243b914")
26
- end
27
-
28
- it 'should get eng order' do
29
- client.stubs.get("/v1.0/accounts/accountId/emergencyNotificationGroupOrders/id") {|env| [200, {}, Helper.xml['emergencyNotificationGroupOrder']]}
30
- order = EmergencyNotificationGroups.get_emergency_notification_group_order(client, "id")
31
- expect(order[:order_id]).to eql("900b3646-18df-4626-b237-3a8de648ebf6")
32
- end
33
- end
34
-
35
- describe '#EngTests' do
36
- it 'should get eng' do
37
- client.stubs.get("/v1.0/accounts/accountId/emergencyNotificationGroups/id") {|env| [200, {}, Helper.xml['emergencyNotificationGroup']]}
38
- eng = EmergencyNotificationGroups.get_emergency_notification_group(client, "id")
39
- expect(eng[:identifier]).to eql("63865500-0904-46b1-9b4f-7bd237a26363")
40
- end
41
-
42
- it 'should get engs' do
43
- client.stubs.get("/v1.0/accounts/accountId/emergencyNotificationGroups") {|env| [200, {}, Helper.xml['emergencyNotificationGroups']]}
44
- engs = EmergencyNotificationGroups.get_emergency_notification_groups(client)
45
- expect(engs[:emergency_notification_groups][:emergency_notification_group][0][:identifier]).to eql("63865500-0904-46b1-9b4f-7bd237a26363")
46
- end
47
- end
48
- end
@@ -1,48 +0,0 @@
1
- describe BandwidthIris::EmergencyNotificationRecipients do
2
- client = nil
3
-
4
- before :each do
5
- client = Helper.get_client()
6
- end
7
-
8
- after :each do
9
- client.stubs.verify_stubbed_calls()
10
- end
11
-
12
- describe '#EnrTests' do
13
- it 'should create enr' do
14
- data = {
15
- :value => "value"
16
- }
17
- client.stubs.post("/v1.0/accounts/accountId/emergencyNotificationRecipients", client.build_xml({:emergency_notification_recipient => data})) {|env| [200, {}, Helper.xml['emergencyNotificationRecipient']]}
18
- enr = EmergencyNotificationRecipients.create_emergency_notification_recipient(client, data)
19
- expect(enr[:identifier]).to eql(" 63865500-0904-46b1-9b4f-7bd237a26363 ")
20
- end
21
-
22
- it 'should get enrs' do
23
- client.stubs.get("/v1.0/accounts/accountId/emergencyNotificationRecipients") {|env| [200, {}, Helper.xml['emergencyNotificationRecipients']]}
24
- enrs = EmergencyNotificationRecipients.get_emergency_notification_recipients(client)
25
- expect(enrs[:emergency_notification_recipients][:emergency_notification_recipient][0][:identifier]).to eql(" 63865500-0904-46b1-9b4f-7bd237a26363 ")
26
- end
27
-
28
- it 'should get enr' do
29
- client.stubs.get("/v1.0/accounts/accountId/emergencyNotificationRecipients/id") {|env| [200, {}, Helper.xml['emergencyNotificationRecipient']]}
30
- enr = EmergencyNotificationRecipients.get_emergency_notification_recipient(client, "id")
31
- expect(enr[:identifier]).to eql(" 63865500-0904-46b1-9b4f-7bd237a26363 ")
32
- end
33
-
34
- it 'should replace enr' do
35
- data = {
36
- :value => "value"
37
- }
38
- client.stubs.put("/v1.0/accounts/accountId/emergencyNotificationRecipients/id", client.build_xml({:emergency_notification_recipient => data})) {|env| [200, {}, Helper.xml['emergencyNotificationRecipient']]}
39
- enr = EmergencyNotificationRecipients.replace_emergency_notification_recipient(client, "id", data)
40
- expect(enr[:identifier]).to eql(" 63865500-0904-46b1-9b4f-7bd237a26363 ")
41
- end
42
-
43
- it 'should delete enr' do
44
- client.stubs.delete("/v1.0/accounts/accountId/emergencyNotificationRecipients/id") {|env| [200, {}, '']}
45
- EmergencyNotificationRecipients.delete_emergency_notification_recipient(client, "id")
46
- end
47
- end
48
- end
@@ -1,162 +0,0 @@
1
- describe BandwidthIris::SipPeerProducts do
2
- client = nil
3
-
4
- before :each do
5
- client = Helper.get_client()
6
- end
7
-
8
- after :each do
9
- client.stubs.verify_stubbed_calls()
10
- end
11
-
12
- describe '#originationSettings' do
13
- it 'should get origination settings' do
14
- client.stubs.get("/v1.0/accounts/accountId/sites/siteId/sippeers/sippeerId/products/origination/settings"){|env| [200, {}, Helper.xml['sippeerOriginationSettings']]}
15
- settings = SipPeerProducts.get_origination_settings(client, "siteId", "sippeerId")
16
- expect(settings[:voice_protocol]).to eql("HTTP")
17
- end
18
- it 'should create origination settings' do
19
- data = {
20
- :voice_protocol => "HTTP"
21
- }
22
- client.stubs.post("/v1.0/accounts/accountId/sites/siteId/sippeers/sippeerId/products/origination/settings", client.build_xml({:sip_peer_origination_settings => data})){|env| [200, {}, Helper.xml['sippeerOriginationSettings']]}
23
- settings = SipPeerProducts.create_origination_settings(client, "siteId", "sippeerId", data)
24
- expect(settings[:voice_protocol]).to eql("HTTP")
25
- end
26
- it 'should update origination settings' do
27
- data = {
28
- :voice_protocol => "HTTP"
29
- }
30
- client.stubs.put("/v1.0/accounts/accountId/sites/siteId/sippeers/sippeerId/products/origination/settings", client.build_xml({:sip_peer_origination_settings => data})){|env| [200, {}, Helper.xml['sippeerOriginationSettings']]}
31
- SipPeerProducts.update_origination_settings(client, "siteId", "sippeerId", data)
32
- end
33
- end
34
-
35
- describe '#terminationSettings' do
36
- it 'should get termination settings' do
37
- client.stubs.get("/v1.0/accounts/accountId/sites/siteId/sippeers/sippeerId/products/termination/settings"){|env| [200, {}, Helper.xml['sippeerTerminationSettings']]}
38
- settings = SipPeerProducts.get_termination_settings(client, "siteId", "sippeerId")
39
- expect(settings[:voice_protocol]).to eql("HTTP")
40
- end
41
- it 'should create termination settings' do
42
- data = {
43
- :voice_protocol => "HTTP"
44
- }
45
- client.stubs.post("/v1.0/accounts/accountId/sites/siteId/sippeers/sippeerId/products/termination/settings", client.build_xml({:sip_peer_termination_settings => data})){|env| [200, {}, Helper.xml['sippeerTerminationSettings']]}
46
- settings = SipPeerProducts.create_termination_settings(client, "siteId", "sippeerId", data)
47
- expect(settings[:voice_protocol]).to eql("HTTP")
48
- end
49
- it 'should update termination settings' do
50
- data = {
51
- :voice_protocol => "HTTP"
52
- }
53
- client.stubs.put("/v1.0/accounts/accountId/sites/siteId/sippeers/sippeerId/products/termination/settings", client.build_xml({:sip_peer_termination_settings => data})){|env| [200, {}, Helper.xml['sippeerTerminationSettings']]}
54
- SipPeerProducts.update_termination_settings(client, "siteId", "sippeerId", data)
55
- end
56
- end
57
-
58
- describe '#smsFeatureSettings' do
59
- it 'should get sms feature settings' do
60
- client.stubs.get("/v1.0/accounts/accountId/sites/siteId/sippeers/sippeerId/products/messaging/features/sms"){|env| [200, {}, Helper.xml['sippeerSmsFeature']]}
61
- settings = SipPeerProducts.get_sms_feature_settings(client, "siteId", "sippeerId")
62
- expect(settings[:sip_peer_sms_feature_settings][:toll_free]).to eql(true)
63
- end
64
- it 'should create sms feature settings' do
65
- data = {
66
- :sip_peer_sms_feature_settings => {
67
- :toll_free => true
68
- }
69
- }
70
- client.stubs.post("/v1.0/accounts/accountId/sites/siteId/sippeers/sippeerId/products/messaging/features/sms", client.build_xml({:sip_peer_sms_feature => data})){|env| [200, {}, Helper.xml['sippeerSmsFeature']]}
71
- settings = SipPeerProducts.create_sms_feature_settings(client, "siteId", "sippeerId", data)
72
- expect(settings[:sip_peer_sms_feature_settings][:toll_free]).to eql(true)
73
- end
74
- it 'should update sms feature settings' do
75
- data = {
76
- :sip_peer_sms_feature_settings => {
77
- :toll_free => true
78
- }
79
- }
80
- client.stubs.put("/v1.0/accounts/accountId/sites/siteId/sippeers/sippeerId/products/messaging/features/sms", client.build_xml({:sip_peer_sms_feature => data})){|env| [200, {}, Helper.xml['sippeerSmsFeature']]}
81
- settings = SipPeerProducts.update_sms_feature_settings(client, "siteId", "sippeerId", data)
82
- expect(settings[:sip_peer_sms_feature_settings][:toll_free]).to eql(true)
83
- end
84
- it 'should delete sms feature settings' do
85
- client.stubs.delete("/v1.0/accounts/accountId/sites/siteId/sippeers/sippeerId/products/messaging/features/sms"){|env| [200, {}, Helper.xml['sippeerSmsFeature']]}
86
- SipPeerProducts.delete_sms_feature_settings(client, "siteId", "sippeerId")
87
- end
88
- end
89
-
90
- describe '#mmsFeatureSettings' do
91
- it 'should get mms feature settings' do
92
- client.stubs.get("/v1.0/accounts/accountId/sites/siteId/sippeers/sippeerId/products/messaging/features/mms"){|env| [200, {}, Helper.xml['sippeerMmsFeature']]}
93
- settings = SipPeerProducts.get_mms_feature_settings(client, "siteId", "sippeerId")
94
- expect(settings[:mms_settings][:protocol]).to eql("MM4")
95
- end
96
- it 'should create mms feature settings' do
97
- data = {
98
- :mms_settings => {
99
- :protocol => "MM4"
100
- }
101
- }
102
- client.stubs.post("/v1.0/accounts/accountId/sites/siteId/sippeers/sippeerId/products/messaging/features/mms", client.build_xml({:mms_feature => data})){|env| [200, {}, Helper.xml['sippeerMmsFeature']]}
103
- settings = SipPeerProducts.create_mms_feature_settings(client, "siteId", "sippeerId", data)
104
- expect(settings[:mms_settings][:protocol]).to eql("MM4")
105
- end
106
- it 'should update mms feature settings' do
107
- data = {
108
- :mms_settings => {
109
- :protocol => "MM4"
110
- }
111
- }
112
- client.stubs.put("/v1.0/accounts/accountId/sites/siteId/sippeers/sippeerId/products/messaging/features/mms", client.build_xml({:mms_feature => data})){|env| [200, {}, Helper.xml['sippeerMmsFeature']]}
113
- SipPeerProducts.update_mms_feature_settings(client, "siteId", "sippeerId", data)
114
- end
115
- it 'should delete mms feature settings' do
116
- client.stubs.delete("/v1.0/accounts/accountId/sites/siteId/sippeers/sippeerId/products/messaging/features/mms"){|env| [200, {}, Helper.xml['sippeerMmsFeature']]}
117
- SipPeerProducts.delete_mms_feature_settings(client, "siteId", "sippeerId")
118
- end
119
- end
120
-
121
- describe '#mmsFeatureMmsSettings' do
122
- it 'should get mms feature mms settings' do
123
- client.stubs.get("/v1.0/accounts/accountId/sites/siteId/sippeers/sippeerId/products/messaging/features/mms/settings"){|env| [200, {}, Helper.xml['sippeerMmsFeatureMmsSettings']]}
124
- settings = SipPeerProducts.get_mms_feature_mms_settings(client, "siteId", "sippeerId")
125
- expect(settings[:protocol]).to eql("MM4")
126
- end
127
- end
128
-
129
- describe '#messagingApplicationSettings' do
130
- it 'should get messaging application settings' do
131
- client.stubs.get("/v1.0/accounts/accountId/sites/siteId/sippeers/sippeerId/products/messaging/applicationSettings"){|env| [200, {}, Helper.xml['messagingApplicationSettings']]}
132
- settings = SipPeerProducts.get_messaging_application_settings(client, "siteId", "sippeerId")
133
- expect(settings[:http_messaging_v2_app_id]).to eql("4a4ca6c1-156b-4fca-84e9-34e35e2afc32")
134
- end
135
- it 'should update messaging application settings' do
136
- data = {
137
- :http_messaging_v2_app_id => "4a4ca6c1-156b-4fca-84e9-34e35e2afc32"
138
- }
139
- client.stubs.put("/v1.0/accounts/accountId/sites/siteId/sippeers/sippeerId/products/messaging/applicationSettings", client.build_xml({:applications_settings => data})){|env| [200, {}, Helper.xml['messagingApplicationSettings']]}
140
- settings = SipPeerProducts.update_messaging_application_settings(client, "siteId", "sippeerId", data)
141
- expect(settings[:http_messaging_v2_app_id]).to eql("4a4ca6c1-156b-4fca-84e9-34e35e2afc32")
142
- end
143
- end
144
-
145
- describe '#messagingSettings' do
146
- it 'should get messaging settings' do
147
- client.stubs.get("/v1.0/accounts/accountId/sites/siteId/sippeers/sippeerId/products/messaging/settings"){|env| [200, {}, Helper.xml['sippeerMessageSettings']]}
148
- settings = SipPeerProducts.get_messaging_settings(client, "siteId", "sippeerId")
149
- expect(settings[:break_out_countries][:country]).to eql("CAN")
150
- end
151
- it 'should update messaging settings' do
152
- data = {
153
- :break_out_countries => {
154
- :country => "CAN"
155
- }
156
- }
157
- client.stubs.put("/v1.0/accounts/accountId/sites/siteId/sippeers/sippeerId/products/messaging/settings", client.build_xml({:sip_peer_messaging_settings => data})){|env| [200, {}, Helper.xml['sippeerMessageSettings']]}
158
- settings = SipPeerProducts.update_messaging_settings(client, "siteId", "sippeerId", data)
159
- expect(settings[:break_out_countries][:country]).to eql("CAN")
160
- end
161
- end
162
- end
@@ -1,42 +0,0 @@
1
- describe BandwidthIris::TnOptions do
2
- client = nil
3
-
4
- before :each do
5
- client = Helper.get_client()
6
- end
7
-
8
- after :each do
9
- client.stubs.verify_stubbed_calls()
10
- end
11
-
12
- describe "#tnOptionOrders" do
13
- it "should get tn option orders" do
14
- client.stubs.get("/v1.0/accounts/accountId/tnoptions"){|env| [200, {}, Helper.xml['tnOptionOrders']]}
15
- orders = TnOptions.get_tn_option_orders(client)
16
- expect(orders[:tn_option_order_summary][0][:account_id]).to eql(14)
17
- end
18
-
19
- it "should create tn option order" do
20
- data = {
21
- :customer_order_id => "12345",
22
- :tn_option_groups => {
23
- :tn_option_group => [
24
- {
25
- :number_format => "10digit",
26
- :RPIDFormat => "10digit"
27
- }
28
- ]
29
- }
30
- }
31
- client.stubs.post("/v1.0/accounts/accountId/tnoptions", client.build_xml({:tn_option_order => data})){|env| [200, {}, Helper.xml['tnOptionOrderResponse']]}
32
- order = TnOptions.create_tn_option_order(client, data)
33
- expect(order[:account_id]).to eql(14)
34
- end
35
-
36
- it "should get tn option order" do
37
- client.stubs.get("/v1.0/accounts/accountId/tnoptions/id"){|env| [200, {}, Helper.xml['tnOptionOrder']]}
38
- order = TnOptions.get_tn_option_order(client, "id")
39
- expect(order[:account_id]).to eql(14)
40
- end
41
- end
42
- end