zoom_rb 0.9.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +1 -1
- data/.gitignore +2 -1
- data/CHANGELOG.md +53 -0
- data/Gemfile.lock +85 -51
- data/Makefile +1 -1
- data/README.md +31 -3
- data/lib/zoom/actions/account.rb +18 -76
- data/lib/zoom/actions/billing.rb +41 -0
- data/lib/zoom/actions/dashboard.rb +22 -0
- data/lib/zoom/actions/groups.rb +19 -0
- data/lib/zoom/actions/im/chat.rb +13 -14
- data/lib/zoom/actions/meeting.rb +38 -63
- data/lib/zoom/actions/phone.rb +15 -0
- data/lib/zoom/actions/recording.rb +13 -22
- data/lib/zoom/actions/report.rb +8 -43
- data/lib/zoom/actions/roles.rb +24 -0
- data/lib/zoom/actions/sip_audio.rb +34 -0
- data/lib/zoom/actions/token.rb +26 -0
- data/lib/zoom/actions/user.rb +66 -139
- data/lib/zoom/actions/webinar.rb +43 -84
- data/lib/zoom/actions.rb +49 -0
- data/lib/zoom/client.rb +27 -16
- data/lib/zoom/clients/jwt.rb +22 -0
- data/lib/zoom/clients/oauth.rb +60 -0
- data/lib/zoom/constants/account/options/pay_modes.rb +12 -0
- data/lib/zoom/constants/account/settings/permitted_settings.rb +125 -0
- data/lib/zoom/constants/constants.rb +35 -0
- data/lib/zoom/constants/meeting/approval_types.rb +11 -0
- data/lib/zoom/constants/meeting/audio_type.rb +11 -0
- data/lib/zoom/constants/meeting/auto_recording.rb +11 -0
- data/lib/zoom/constants/meeting/registration_types.rb +11 -0
- data/lib/zoom/constants/meeting/types.rb +12 -0
- data/lib/zoom/constants/recurrence/monthly_weeks.rb +13 -0
- data/lib/zoom/constants/recurrence/types.rb +11 -0
- data/lib/zoom/constants/recurrence/weekly_days.rb +15 -0
- data/lib/zoom/constants/user/create_types.rb +12 -0
- data/lib/zoom/constants/user/types.rb +11 -0
- data/lib/zoom/constants/webinar/approval_types.rb +11 -0
- data/lib/zoom/constants/webinar/audio_type.rb +11 -0
- data/lib/zoom/constants/webinar/auto_recording.rb +11 -0
- data/lib/zoom/constants/webinar/registration_types.rb +11 -0
- data/lib/zoom/constants/webinar/types.rb +11 -0
- data/lib/zoom/error.rb +9 -1
- data/lib/zoom/params.rb +51 -12
- data/lib/zoom/utils.rb +22 -38
- data/lib/zoom/version.rb +2 -2
- data/lib/{zoom.rb → zoom_rb.rb} +12 -5
- data/spec/fixtures/account/create.json +6 -0
- data/spec/{lib/zoom/actions/report/hosts_report_spec.rb → fixtures/account/delete.json} +0 -0
- data/spec/fixtures/account/get.json +13 -0
- data/spec/fixtures/account/list.json +18 -0
- data/spec/fixtures/account/managed_domains.json +7 -0
- data/spec/fixtures/account/options_update.json +7 -0
- data/spec/fixtures/account/settings_get.json +120 -0
- data/spec/{lib/zoom/actions/report/meeting_polls_report_spec.rb → fixtures/account/settings_update.json} +0 -0
- data/spec/fixtures/account/trusted_domains.json +3 -0
- data/spec/fixtures/billing/get.json +12 -0
- data/spec/fixtures/billing/plans_list.json +44 -0
- data/spec/fixtures/billing/plans_subscribe.json +30 -0
- data/spec/fixtures/billing/plans_usage.json +30 -0
- data/spec/{lib/zoom/actions/report/meetings_report_spec.rb → fixtures/billing/update.json} +0 -0
- data/spec/fixtures/chat/channels/get.json +5 -0
- data/spec/fixtures/chat/users/channels/list.json +17 -0
- data/spec/fixtures/dashboard/crc.json +104 -0
- data/spec/fixtures/dashboard/meeting/detail.json +20 -0
- data/spec/fixtures/dashboard/meeting/participants.json +56 -0
- data/spec/fixtures/{metrics_meetings.json → dashboard/meetings.json} +1 -2
- data/spec/fixtures/error/admin_cannot_activated.json +4 -0
- data/spec/fixtures/error/channel_not_found.json +4 -0
- data/spec/fixtures/error/group_does_not_exist.json +4 -0
- data/spec/fixtures/error/group_not_belong_to_account.json +4 -0
- data/spec/fixtures/error/group_not_exist.json +4 -0
- data/spec/fixtures/error/meeting_not_exist.json +4 -0
- data/spec/fixtures/error/next_page_token_invalid.json +4 -0
- data/spec/fixtures/error/not_found_administrator.json +4 -0
- data/spec/fixtures/error/unauthorized_request.json +4 -0
- data/spec/fixtures/error/user_not_exist.json +1 -1
- data/spec/fixtures/groups/create.json +5 -0
- data/spec/fixtures/groups/get.json +5 -0
- data/spec/fixtures/groups/list.json +15 -0
- data/spec/{lib/zoom/actions/report/telephone_report_spec.rb → fixtures/groups/update.json} +0 -0
- data/spec/fixtures/meeting/add_registrant.json +7 -0
- data/spec/fixtures/meeting/create.json +31 -16
- data/spec/fixtures/meeting/get.json +43 -33
- data/spec/fixtures/meeting/invitation.json +3 -0
- data/spec/fixtures/meeting/live_stream/errors/meeting_not_found.json +4 -0
- data/spec/fixtures/meeting/live_stream/errors/missing_field.json +10 -0
- data/spec/fixtures/{recording_get.json → recording/get.json} +17 -6
- data/spec/fixtures/recording/list.json +53 -0
- data/spec/fixtures/recording/settings/get.json +7 -0
- data/spec/fixtures/report/meeting/participants.json +17 -0
- data/spec/fixtures/report/meeting.json +19 -0
- data/spec/fixtures/roles/assign.json +4 -0
- data/spec/fixtures/roles/create.json +9 -0
- data/spec/fixtures/roles/get.json +11 -0
- data/spec/fixtures/roles/list.json +29 -0
- data/spec/fixtures/roles/members.json +15 -0
- data/spec/fixtures/sip_audio/sip_trunks_get.json +19 -0
- data/spec/fixtures/sip_audio/sip_trunks_internal_callout_countries_add.json +10 -0
- data/spec/fixtures/sip_audio/sip_trunks_internal_callout_country_list.json +15 -0
- data/spec/fixtures/sip_audio/sip_trunks_internal_numbers_add.json +14 -0
- data/spec/fixtures/sip_audio/sip_trunks_internal_numbers_list.json +16 -0
- data/spec/fixtures/sip_audio/sip_trunks_numbers_assign.json +7 -0
- data/spec/fixtures/sip_audio/sip_trunks_numbers_list.json +9 -0
- data/spec/fixtures/token/access_token.json +7 -0
- data/spec/fixtures/token/data_compliance.json +8 -0
- data/spec/fixtures/token/refresh_token.json +7 -0
- data/spec/fixtures/user/assistant/create.json +4 -0
- data/spec/fixtures/user/assistant/list.json +8 -0
- data/spec/fixtures/user/email_check.json +3 -0
- data/spec/fixtures/user/get.json +35 -21
- data/spec/fixtures/user/list.json +17 -13
- data/spec/fixtures/user/permissions.json +65 -0
- data/spec/fixtures/user/recording/list.json +50 -0
- data/spec/fixtures/user/scheduler/list.json +12 -0
- data/spec/fixtures/user/settings_get.json +74 -0
- data/spec/fixtures/user/token.json +3 -0
- data/spec/{lib/zoom/actions/report/webinar_details_report_spec.rb → fixtures/user/update_email.json} +0 -0
- data/spec/{lib/zoom/actions/report/webinar_polls_report_spec.rb → fixtures/user/update_password.json} +0 -0
- data/spec/{lib/zoom/actions/report/webinar_qa_report_spec.rb → fixtures/user/update_status.json} +0 -0
- data/spec/fixtures/user/vanity_name.json +3 -0
- data/spec/fixtures/webinar/panelist_list.json +12 -0
- data/spec/fixtures/webinar/past_webinar_list.json +8 -0
- data/spec/fixtures/webinar/poll_get.json +13 -0
- data/spec/fixtures/webinar/polls_list.json +16 -0
- data/spec/fixtures/webinar/registrant/get.json +25 -0
- data/spec/lib/zoom/actions/account/create_spec.rb +68 -0
- data/spec/lib/zoom/actions/account/delete_spec.rb +44 -0
- data/spec/lib/zoom/actions/account/get_locked_settings_spec.rb +43 -0
- data/spec/lib/zoom/actions/account/get_spec.rb +43 -0
- data/spec/lib/zoom/actions/account/list_spec.rb +58 -0
- data/spec/lib/zoom/actions/account/managed_domains_spec.rb +43 -0
- data/spec/lib/zoom/actions/account/options_update_spec.rb +58 -0
- data/spec/lib/zoom/actions/account/settings_get_spec.rb +50 -0
- data/spec/lib/zoom/actions/account/settings_update_spec.rb +55 -0
- data/spec/lib/zoom/actions/account/trusted_domains_spec.rb +43 -0
- data/spec/lib/zoom/actions/billing/get_spec.rb +48 -0
- data/spec/lib/zoom/actions/billing/plans_list_spec.rb +48 -0
- data/spec/lib/zoom/actions/billing/plans_subscribe_spec.rb +69 -0
- data/spec/lib/zoom/actions/billing/plans_usage_spec.rb +48 -0
- data/spec/lib/zoom/actions/billing/update_spec.rb +64 -0
- data/spec/lib/zoom/actions/dashboard/crc_spec.rb +33 -0
- data/spec/lib/zoom/actions/dashboard/meeting_details_spec.rb +62 -0
- data/spec/lib/zoom/actions/dashboard/meeting_participants_spec.rb +74 -0
- data/spec/lib/zoom/actions/dashboard/meetings_spec.rb +63 -0
- data/spec/lib/zoom/actions/groups/create_spec.rb +98 -0
- data/spec/lib/zoom/actions/{group → groups}/delete_spec.rb +0 -0
- data/spec/lib/zoom/actions/{group → groups}/edit_spec.rb +0 -0
- data/spec/lib/zoom/actions/groups/get_spec.rb +62 -0
- data/spec/lib/zoom/actions/groups/list_spec.rb +47 -0
- data/spec/lib/zoom/actions/{group → groups}/member/add_spec.rb +0 -0
- data/spec/lib/zoom/actions/{group → groups}/member/delete_spec.rb +0 -0
- data/spec/lib/zoom/actions/{group → groups/member}/list_spec.rb +0 -0
- data/spec/lib/zoom/actions/groups/update_spec.rb +59 -0
- data/spec/lib/zoom/actions/im/chat/channels/get_spec.rb +64 -0
- data/spec/lib/zoom/actions/im/chat/users/channels/get_spec.rb +45 -0
- data/spec/lib/zoom/actions/meeting/add_registrant_spec.rb +30 -0
- data/spec/lib/zoom/actions/meeting/create_spec.rb +13 -13
- data/spec/lib/zoom/actions/meeting/delete_spec.rb +17 -34
- data/spec/lib/zoom/actions/meeting/get_spec.rb +21 -31
- data/spec/lib/zoom/actions/meeting/invitation_spec.rb +48 -0
- data/spec/lib/zoom/actions/meeting/livestream_spec.rb +61 -0
- data/spec/lib/zoom/actions/meeting/update_spec.rb +48 -42
- data/spec/lib/zoom/actions/recording/file_delete_spec.rb +33 -0
- data/spec/lib/zoom/actions/recording/get_spec.rb +19 -35
- data/spec/lib/zoom/actions/recording/list_spec.rb +20 -26
- data/spec/lib/zoom/actions/recording/settings/get_spec.rb +42 -0
- data/spec/lib/zoom/actions/recording/settings/update_spec.rb +32 -0
- data/spec/lib/zoom/actions/report/meeting_details_report_spec.rb +44 -0
- data/spec/lib/zoom/actions/report/meeting_participants_report_spec.rb +44 -0
- data/spec/lib/zoom/actions/report/webinar_participants_report_spec.rb +2 -2
- data/spec/lib/zoom/actions/roles/assign_spec.rb +25 -0
- data/spec/lib/zoom/actions/roles/create_spec.rb +55 -0
- data/spec/lib/zoom/actions/roles/get_spec.rb +37 -0
- data/spec/lib/zoom/actions/roles/list_spec.rb +28 -0
- data/spec/lib/zoom/actions/roles/members_spec.rb +35 -0
- data/spec/lib/zoom/actions/roles/unassign_spec.rb +34 -0
- data/spec/lib/zoom/actions/sip_audio/add_trunks_internal_callout_countries_spec.rb +25 -0
- data/spec/lib/zoom/actions/sip_audio/add_trunks_internal_numbers_spec.rb +25 -0
- data/spec/lib/zoom/actions/sip_audio/assign_numbers_spec.rb +29 -0
- data/spec/lib/zoom/actions/sip_audio/delete_internal_callout_countries_spec.rb +44 -0
- data/spec/lib/zoom/actions/sip_audio/delete_trunk_internal_numbers_spec.rb +44 -0
- data/spec/lib/zoom/actions/sip_audio/delete_trunk_numbers_spec.rb +44 -0
- data/spec/lib/zoom/actions/sip_audio/delete_trunks_spec.rb +44 -0
- data/spec/lib/zoom/actions/sip_audio/get_trunks_spec.rb +50 -0
- data/spec/lib/zoom/actions/sip_audio/list_trunk_numbers_spec.rb +46 -0
- data/spec/lib/zoom/actions/sip_audio/list_trunks_internal_callout_country_spec.rb +53 -0
- data/spec/lib/zoom/actions/sip_audio/list_trunks_internal_numbers_spec.rb +53 -0
- data/spec/lib/zoom/actions/token/access_token_spec.rb +26 -0
- data/spec/lib/zoom/actions/token/data_compliance_spec.rb +41 -0
- data/spec/lib/zoom/actions/token/refresh_token_spec.rb +26 -0
- data/spec/lib/zoom/actions/user/assistant/create_spec.rb +59 -0
- data/spec/lib/zoom/actions/user/assistant/delete_all_spec.rb +44 -0
- data/spec/lib/zoom/actions/user/assistant/delete_spec.rb +48 -1
- data/spec/lib/zoom/actions/user/assistant/list_spec.rb +53 -0
- data/spec/lib/zoom/actions/user/create_spec.rb +20 -48
- data/spec/lib/zoom/actions/user/delete_spec.rb +2 -2
- data/spec/lib/zoom/actions/user/email_check_spec.rb +43 -0
- data/spec/lib/zoom/actions/user/get_spec.rb +12 -3
- data/spec/lib/zoom/actions/user/list_recordings_spec.rb +57 -0
- data/spec/lib/zoom/actions/user/list_spec.rb +34 -3
- data/spec/lib/zoom/actions/user/permissions_spec.rb +52 -0
- data/spec/lib/zoom/actions/user/scheduler/delete_all_spec.rb +44 -0
- data/spec/lib/zoom/actions/user/scheduler/delete_spec.rb +50 -0
- data/spec/lib/zoom/actions/user/scheduler/list_spec.rb +53 -0
- data/spec/lib/zoom/actions/user/settings_get_spec.rb +56 -0
- data/spec/lib/zoom/actions/user/settings_update_spec.rb +50 -0
- data/spec/lib/zoom/actions/user/token_spec.rb +61 -0
- data/spec/lib/zoom/actions/user/update_email_spec.rb +59 -0
- data/spec/lib/zoom/actions/user/update_password_spec.rb +29 -0
- data/spec/lib/zoom/actions/user/update_spec.rb +2 -2
- data/spec/lib/zoom/actions/user/update_status_spec.rb +59 -0
- data/spec/lib/zoom/actions/user/vanity_name_spec.rb +51 -0
- data/spec/lib/zoom/actions/webinar/create_spec.rb +49 -44
- data/spec/lib/zoom/actions/webinar/delete_spec.rb +3 -3
- data/spec/lib/zoom/actions/webinar/get_spec.rb +1 -1
- data/spec/lib/zoom/actions/webinar/list_spec.rb +2 -2
- data/spec/lib/zoom/actions/webinar/panelist_list_spec.rb +44 -0
- data/spec/lib/zoom/actions/webinar/past_webinar_list_spec.rb +44 -0
- data/spec/lib/zoom/actions/webinar/poll_get_spec.rb +47 -0
- data/spec/lib/zoom/actions/webinar/polls_list_spec.rb +44 -0
- data/spec/lib/zoom/actions/webinar/registrants/add_spec.rb +2 -2
- data/spec/lib/zoom/actions/webinar/registrants/get_spec.rb +49 -0
- data/spec/lib/zoom/actions/webinar/registrants/list_spec.rb +2 -2
- data/spec/lib/zoom/actions/webinar/registrants/update_status_spec.rb +1 -1
- data/spec/lib/zoom/actions/webinar/update_spec.rb +2 -2
- data/spec/lib/zoom/actions_spec.rb +84 -0
- data/spec/lib/zoom/client_spec.rb +85 -7
- data/spec/lib/zoom/params_spec.rb +23 -3
- data/spec/lib/zoom/utils_spec.rb +13 -18
- data/spec/spec_helper.rb +23 -2
- data/zoom_rb.gemspec +1 -1
- metadata +343 -112
- data/.ruby-version +0 -1
- data/lib/zoom/actions/group.rb +0 -8
- data/lib/zoom/actions/metrics.rb +0 -27
- data/lib/zoom/constants.rb +0 -103
- data/spec/fixtures/meeting/delete.json +0 -4
- data/spec/fixtures/meeting/end.json +0 -4
- data/spec/fixtures/meeting/live.json +0 -32
- data/spec/fixtures/meeting/register.json +0 -7
- data/spec/fixtures/meeting/update.json +0 -4
- data/spec/fixtures/metrics_crc.json +0 -105
- data/spec/fixtures/metrics_meetingdetail.json +0 -32
- data/spec/fixtures/recording_delete.json +0 -4
- data/spec/fixtures/recording_list.json +0 -51
- data/spec/fixtures/user/assistant/delete.json +0 -5
- data/spec/lib/zoom/actions/group/create_spec.rb +0 -3
- data/spec/lib/zoom/actions/group/get_spec.rb +0 -3
- data/spec/lib/zoom/actions/group/member/list_spec.rb +0 -3
- data/spec/lib/zoom/actions/meeting/end_spec.rb +0 -55
- data/spec/lib/zoom/actions/meeting/live_spec.rb +0 -43
- data/spec/lib/zoom/actions/meeting/register_spec.rb +0 -45
- data/spec/lib/zoom/actions/metrics/crc_spec.rb +0 -48
- data/spec/lib/zoom/actions/metrics/im_spec.rb +0 -3
- data/spec/lib/zoom/actions/metrics/meetingdetail_spec.rb +0 -51
- data/spec/lib/zoom/actions/metrics/meetings_spec.rb +0 -61
- data/spec/lib/zoom/actions/metrics/qos_spec.rb +0 -3
- data/spec/lib/zoom/actions/metrics/webinardetail_spec.rb +0 -3
- data/spec/lib/zoom/actions/metrics/webinars_spec.rb +0 -3
- data/spec/lib/zoom/actions/metrics/zoomroomdetail_spec.rb +0 -3
- data/spec/lib/zoom/actions/metrics/zoomrooms_spec.rb +0 -3
- data/spec/lib/zoom/actions/recording/delete_spec.rb +0 -52
- data/spec/lib/zoom/actions/recording/mc_list_spec.rb +0 -51
- data/spec/lib/zoom/actions/user/activate_spec.rb +0 -3
- data/spec/lib/zoom/actions/user/checkemail_spec.rb +0 -3
- data/spec/lib/zoom/actions/user/checkzpk_spec.rb +0 -3
- data/spec/lib/zoom/actions/user/deactivate_spec.rb +0 -3
- data/spec/lib/zoom/actions/user/revoketoken_spec.rb +0 -3
- data/spec/lib/zoom/actions/user/updatepassword_spec.rb +0 -3
- data/spec/lib/zoom/actions/webinar/panelists_spec.rb +0 -3
- data/spec/lib/zoom/actions/webinar/polls_spec.rb +0 -3
@@ -0,0 +1,53 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Zoom::Actions::User do
|
6
|
+
let(:zc) { zoom_client }
|
7
|
+
let(:args) { { user_id: 'ufR93M2pRyy8ePFN92dttq' } }
|
8
|
+
|
9
|
+
describe '#user_assistants_list action' do
|
10
|
+
context 'with a valid response' do
|
11
|
+
before :each do
|
12
|
+
stub_request(
|
13
|
+
:get,
|
14
|
+
zoom_url("/users/#{args[:user_id]}/assistants")
|
15
|
+
).to_return(body: json_response('user', 'assistant', 'list'),
|
16
|
+
headers: { 'Content-Type' => 'application/json' })
|
17
|
+
end
|
18
|
+
|
19
|
+
it "requires user_id param" do
|
20
|
+
expect {
|
21
|
+
zc.user_assistants_list(filter_key(args, :user_id))
|
22
|
+
}.to raise_error(Zoom::ParameterMissing, [:user_id].to_s)
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'returns a hash' do
|
26
|
+
expect(zc.user_assistants_list(args)).to be_kind_of(Hash)
|
27
|
+
end
|
28
|
+
|
29
|
+
it "returns 'assistants' count" do
|
30
|
+
expect(zc.user_assistants_list(args)['assistants'].count).to eq(1)
|
31
|
+
end
|
32
|
+
|
33
|
+
it "returns 'assistants' Array" do
|
34
|
+
expect(zc.user_assistants_list(args)['assistants']).to be_kind_of(Array)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
context 'with a 4xx response' do
|
39
|
+
before :each do
|
40
|
+
stub_request(
|
41
|
+
:get,
|
42
|
+
zoom_url("/users/#{args[:user_id]}/assistants")
|
43
|
+
).to_return(status: 404,
|
44
|
+
body: json_response('error', 'not_found'),
|
45
|
+
headers: { 'Content-Type' => 'application/json' })
|
46
|
+
end
|
47
|
+
|
48
|
+
it 'raises Zoom::Error exception' do
|
49
|
+
expect { zc.user_assistants_list(args) }.to raise_error(Zoom::Error)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -5,12 +5,16 @@ require 'spec_helper'
|
|
5
5
|
describe Zoom::Actions::User do
|
6
6
|
let(:zc) { zoom_client }
|
7
7
|
let(:args) do
|
8
|
-
{
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
8
|
+
{
|
9
|
+
action: 'create',
|
10
|
+
user_info: {
|
11
|
+
email: 'foo@bar.com',
|
12
|
+
type: 1,
|
13
|
+
first_name: 'Zoomie',
|
14
|
+
last_name: 'Userton',
|
15
|
+
password: 'testerino'
|
16
|
+
}
|
17
|
+
}
|
14
18
|
end
|
15
19
|
|
16
20
|
describe '#user_create' do
|
@@ -21,53 +25,21 @@ describe Zoom::Actions::User do
|
|
21
25
|
zoom_url('/users')
|
22
26
|
).to_return(status: 201,
|
23
27
|
body: json_response('user', 'create'),
|
24
|
-
headers: {
|
28
|
+
headers: { 'Content-Type' => 'application/json' })
|
25
29
|
end
|
26
30
|
|
27
31
|
it 'requires action param' do
|
28
32
|
expect { zc.user_create(filter_key(args, :action)) }.to raise_error(Zoom::ParameterMissing, [:action].to_s)
|
29
33
|
end
|
30
34
|
|
31
|
-
it 'does not raise an error when action is create' do
|
32
|
-
args[:action] = 'create'
|
33
|
-
expect { zc.user_create(args) }.not_to raise_error
|
34
|
-
end
|
35
|
-
|
36
|
-
it 'does not raise an error when action is custCreate' do
|
37
|
-
args[:action] = 'custCreate'
|
38
|
-
expect { zc.user_create(args) }.not_to raise_error
|
39
|
-
end
|
40
|
-
|
41
|
-
it 'does not raise an error when action is autoCreate' do
|
42
|
-
args[:action] = 'autoCreate'
|
43
|
-
expect { zc.user_create(args) }.not_to raise_error
|
44
|
-
end
|
45
|
-
|
46
|
-
it 'does not raise an error when action is ssoCreate' do
|
47
|
-
args[:action] = 'ssoCreate'
|
48
|
-
expect { zc.user_create(args) }.not_to raise_error
|
49
|
-
end
|
50
|
-
|
51
|
-
it 'requires valid action' do
|
52
|
-
args[:action] = 'baz'
|
53
|
-
expect { zc.user_create(args) }.to raise_error(Zoom::ParameterValueNotPermitted, "#{:action.to_s}: #{args[:action].to_s}")
|
54
|
-
end
|
55
|
-
|
56
35
|
it 'requires email param' do
|
57
|
-
|
36
|
+
args[:user_info].delete(:email)
|
37
|
+
expect { zc.user_create(args) }.to raise_error(Zoom::ParameterMissing, [{user_info: [:email]}].to_s)
|
58
38
|
end
|
59
39
|
|
60
40
|
it 'requires type param' do
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
it 'does not require password param when action is not autoCreate' do
|
65
|
-
expect { zc.user_create(filter_key(args, :password)) }.not_to raise_error
|
66
|
-
end
|
67
|
-
|
68
|
-
it 'requires password param when action is autoCreate' do
|
69
|
-
args[:action] = 'autoCreate'
|
70
|
-
expect { zc.user_create(filter_key(args, :password)) }.to raise_error(Zoom::ParameterMissing, [:password].to_s)
|
41
|
+
args[:user_info].delete(:type)
|
42
|
+
expect { zc.user_create(args) }.to raise_error(Zoom::ParameterMissing, [{user_info: [:type]}].to_s)
|
71
43
|
end
|
72
44
|
|
73
45
|
it 'returns a hash' do
|
@@ -77,10 +49,10 @@ describe Zoom::Actions::User do
|
|
77
49
|
it 'returns same params' do
|
78
50
|
res = zc.user_create(args)
|
79
51
|
|
80
|
-
expect(res['email']).to eq(args[:email])
|
81
|
-
expect(res['first_name']).to eq(args[:first_name])
|
82
|
-
expect(res['last_name']).to eq(args[:last_name])
|
83
|
-
expect(res['type']).to eq(args[:type])
|
52
|
+
expect(res['email']).to eq(args[:user_info][:email])
|
53
|
+
expect(res['first_name']).to eq(args[:user_info][:first_name])
|
54
|
+
expect(res['last_name']).to eq(args[:user_info][:last_name])
|
55
|
+
expect(res['type']).to eq(args[:user_info][:type])
|
84
56
|
end
|
85
57
|
end
|
86
58
|
|
@@ -91,7 +63,7 @@ describe Zoom::Actions::User do
|
|
91
63
|
zoom_url('/users')
|
92
64
|
).to_return(status: 409,
|
93
65
|
body: json_response('error', 'already_exists'),
|
94
|
-
headers: {
|
66
|
+
headers: { 'Content-Type' => 'application/json' })
|
95
67
|
end
|
96
68
|
|
97
69
|
it 'raises an error' do
|
@@ -14,7 +14,7 @@ describe Zoom::Actions::User do
|
|
14
14
|
zoom_url("/users/#{args[:id]}")
|
15
15
|
).to_return(status: 204,
|
16
16
|
body: json_response('user', 'delete'),
|
17
|
-
headers: {
|
17
|
+
headers: { 'Content-Type' => 'application/json' })
|
18
18
|
end
|
19
19
|
|
20
20
|
it 'requires id param' do
|
@@ -33,7 +33,7 @@ describe Zoom::Actions::User do
|
|
33
33
|
zoom_url("/users/#{args[:id]}")
|
34
34
|
).to_return(status: 404,
|
35
35
|
body: json_response('error', 'not_found'),
|
36
|
-
headers: {
|
36
|
+
headers: { 'Content-Type' => 'application/json' })
|
37
37
|
end
|
38
38
|
|
39
39
|
it 'raises an error' do
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Zoom::Actions::User do
|
6
|
+
let(:zc) { zoom_client }
|
7
|
+
let(:args) { { email: 'test@example.com' } }
|
8
|
+
|
9
|
+
describe '#user_email_check action' do
|
10
|
+
context 'with a valid response' do
|
11
|
+
before :each do
|
12
|
+
stub_request(
|
13
|
+
:get,
|
14
|
+
zoom_url('/users/email')
|
15
|
+
).to_return(body: json_response('user', 'email_check'),
|
16
|
+
headers: { 'Content-Type' => 'application/json' })
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'returns a hash' do
|
20
|
+
expect(zc.user_email_check(args)).to be_kind_of(Hash)
|
21
|
+
end
|
22
|
+
|
23
|
+
it "returns 'existed_email'" do
|
24
|
+
expect(zc.user_email_check(args)['existed_email']).to be_truthy
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
context 'with a 4xx response' do
|
29
|
+
before :each do
|
30
|
+
stub_request(
|
31
|
+
:get,
|
32
|
+
zoom_url('/users/email')
|
33
|
+
).to_return(status: 404,
|
34
|
+
body: json_response('error', 'not_found'),
|
35
|
+
headers: { 'Content-Type' => 'application/json' })
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'raises Zoom::Error exception' do
|
39
|
+
expect { zc.user_email_check(args) }.to raise_error(Zoom::Error)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -4,7 +4,7 @@ require 'spec_helper'
|
|
4
4
|
|
5
5
|
describe Zoom::Actions::User do
|
6
6
|
let(:zc) { zoom_client }
|
7
|
-
let(:args) { { id: '
|
7
|
+
let(:args) { { id: 'z8dsdsdsdsdCfp8uQ' } }
|
8
8
|
|
9
9
|
describe '#user_get action' do
|
10
10
|
context 'with a valid response' do
|
@@ -14,13 +14,18 @@ describe Zoom::Actions::User do
|
|
14
14
|
zoom_url("/users/#{args[:id]}")
|
15
15
|
).to_return(status: 200,
|
16
16
|
body: json_response('user', 'get'),
|
17
|
-
headers: {
|
17
|
+
headers: { 'Content-Type' => 'application/json' })
|
18
18
|
end
|
19
19
|
|
20
20
|
it 'requires id param' do
|
21
21
|
expect { zc.user_get(filter_key(args, :id)) }.to raise_error(Zoom::ParameterMissing, '[:id]')
|
22
22
|
end
|
23
23
|
|
24
|
+
it 'allows login type' do
|
25
|
+
args[:login_type] = '100'
|
26
|
+
expect { zc.user_get(args) }.not_to raise_error
|
27
|
+
end
|
28
|
+
|
24
29
|
it 'returns a hash' do
|
25
30
|
expect(zc.user_get(args)).to be_kind_of(Hash)
|
26
31
|
end
|
@@ -33,6 +38,10 @@ describe Zoom::Actions::User do
|
|
33
38
|
expect(res).to have_key('last_name')
|
34
39
|
expect(res).to have_key('email')
|
35
40
|
expect(res).to have_key('type')
|
41
|
+
expect(res['custom_attributes']).to be_an(Array)
|
42
|
+
expect(res['custom_attributes']).to all(be_a(Hash))
|
43
|
+
expect(res['group_ids']).to be_an(Array)
|
44
|
+
expect(res['im_group_ids']).to be_an(Array)
|
36
45
|
end
|
37
46
|
end
|
38
47
|
|
@@ -43,7 +52,7 @@ describe Zoom::Actions::User do
|
|
43
52
|
zoom_url("/users/#{args[:id]}")
|
44
53
|
).to_return(status: 404,
|
45
54
|
body: json_response('error', 'validation'),
|
46
|
-
headers: {
|
55
|
+
headers: { 'Content-Type' => 'application/json' })
|
47
56
|
end
|
48
57
|
|
49
58
|
it 'raises Zoom::Error exception' do
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Zoom::Actions::User do
|
6
|
+
let(:zc) { zoom_client }
|
7
|
+
let(:args) { { id: 'ufR9342pRyf8ePFN92dttQ' } }
|
8
|
+
|
9
|
+
describe '#user_recordings_list action' do
|
10
|
+
context 'with a valid response' do
|
11
|
+
before :each do
|
12
|
+
stub_request(
|
13
|
+
:get,
|
14
|
+
zoom_url("/users/#{args[:id]}/recordings")
|
15
|
+
).to_return(status: 200,
|
16
|
+
body: json_response('user', 'recording', 'list'),
|
17
|
+
headers: { 'Content-Type' => 'application/json' })
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'requires id param' do
|
21
|
+
expect { zc.user_recordings_list(filter_key(args, :id)) }.to raise_error(Zoom::ParameterMissing, '[:id]')
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'returns a hash' do
|
25
|
+
expect(zc.user_recordings_list(args)).to be_kind_of(Hash)
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'returns same params' do
|
29
|
+
res = zc.user_recordings_list(args)
|
30
|
+
|
31
|
+
expect(res).to have_key('from')
|
32
|
+
expect(res).to have_key('to')
|
33
|
+
expect(res).to have_key('total_records')
|
34
|
+
expect(res).to have_key('meetings')
|
35
|
+
expect(res['meetings'][0]).to have_key('host_id')
|
36
|
+
expect(res['meetings'][0]).to have_key('topic')
|
37
|
+
expect(res['meetings'][0]).to have_key('start_time')
|
38
|
+
expect(res['meetings'][0]).to have_key('recording_count')
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
context 'with a 4xx response' do
|
43
|
+
before :each do
|
44
|
+
stub_request(
|
45
|
+
:get,
|
46
|
+
zoom_url("/users/#{args[:id]}/recordings")
|
47
|
+
).to_return(status: 404,
|
48
|
+
body: json_response('error', 'validation'),
|
49
|
+
headers: { 'Content-Type' => 'application/json' })
|
50
|
+
end
|
51
|
+
|
52
|
+
it 'raises Zoom::Error exception' do
|
53
|
+
expect { zc.user_recordings_list(args) }.to raise_error(Zoom::Error)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -4,6 +4,7 @@ require 'spec_helper'
|
|
4
4
|
|
5
5
|
describe Zoom::Actions::User do
|
6
6
|
let(:zc) { zoom_client }
|
7
|
+
let(:args) { {} }
|
7
8
|
|
8
9
|
describe '#user_list action' do
|
9
10
|
context 'with a valid response' do
|
@@ -12,7 +13,7 @@ describe Zoom::Actions::User do
|
|
12
13
|
:get,
|
13
14
|
zoom_url('/users')
|
14
15
|
).to_return(body: json_response('user', 'list'),
|
15
|
-
headers: {
|
16
|
+
headers: { 'Content-Type' => 'application/json' })
|
16
17
|
end
|
17
18
|
|
18
19
|
it 'returns a hash' do
|
@@ -27,7 +28,37 @@ describe Zoom::Actions::User do
|
|
27
28
|
expect(zc.user_list['users']).to be_kind_of(Array)
|
28
29
|
end
|
29
30
|
|
30
|
-
it '
|
31
|
+
it 'allows status' do
|
32
|
+
args[:status] = 'active'
|
33
|
+
expect { zc.user_list(args) }.not_to raise_error
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'allows page_size' do
|
37
|
+
args[:page_size] = 30
|
38
|
+
expect { zc.user_list(args) }.not_to raise_error
|
39
|
+
end
|
40
|
+
|
41
|
+
it 'allows role_id' do
|
42
|
+
args[:role_id] = '1'
|
43
|
+
expect { zc.user_list(args) }.not_to raise_error
|
44
|
+
end
|
45
|
+
|
46
|
+
it 'allows page_number' do
|
47
|
+
args[:page_number] = 1
|
48
|
+
expect { zc.user_list(args) }.not_to raise_error
|
49
|
+
end
|
50
|
+
|
51
|
+
it 'allows include_fields' do
|
52
|
+
args[:include_fields] = 'host_key'
|
53
|
+
expect { zc.user_list(args) }.not_to raise_error
|
54
|
+
end
|
55
|
+
|
56
|
+
it 'next_page_token' do
|
57
|
+
args[:next_page_token] = 'some_token'
|
58
|
+
expect { zc.user_list(args) }.not_to raise_error
|
59
|
+
end
|
60
|
+
|
61
|
+
it 'raises an error when passed an invalid parameter' do
|
31
62
|
expect { zc.user_list(foo: 'bar', status: 'active') }.to raise_error(Zoom::ParameterNotPermitted, [:foo].to_s)
|
32
63
|
end
|
33
64
|
end
|
@@ -39,7 +70,7 @@ describe Zoom::Actions::User do
|
|
39
70
|
zoom_url('/users')
|
40
71
|
).to_return(status: 404,
|
41
72
|
body: json_response('error', 'not_found'),
|
42
|
-
headers: {
|
73
|
+
headers: { 'Content-Type' => 'application/json' })
|
43
74
|
end
|
44
75
|
|
45
76
|
it 'raises Zoom::Error exception' do
|
@@ -0,0 +1,52 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Zoom::Actions::User do
|
6
|
+
let(:zc) { zoom_client }
|
7
|
+
let(:args) { { user_id: 'ufR9342pRyf8ePFN92dttQ' } }
|
8
|
+
|
9
|
+
describe '#user_permissions action' do
|
10
|
+
context 'with a valid response' do
|
11
|
+
before :each do
|
12
|
+
stub_request(
|
13
|
+
:get,
|
14
|
+
zoom_url("/users/#{args[:user_id]}/permissions")
|
15
|
+
).to_return(status: 200,
|
16
|
+
body: json_response('user', 'permissions'),
|
17
|
+
headers: { 'Content-Type' => 'application/json' })
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'requires user_id param' do
|
21
|
+
expect { zc.user_permissions(filter_key(args, :user_id)) }.to raise_error(Zoom::ParameterMissing, '[:user_id]')
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'returns a hash' do
|
25
|
+
expect(zc.user_permissions(args)).to be_kind_of(Hash)
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'returns same params' do
|
29
|
+
res = zc.user_permissions(args)
|
30
|
+
|
31
|
+
expect(res['permissions']).to be_an(Array)
|
32
|
+
expect(res['permissions']).to all(be_a(String))
|
33
|
+
expect(res['permissions'].size).to equal(61)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
context 'with a 4xx response' do
|
38
|
+
before :each do
|
39
|
+
stub_request(
|
40
|
+
:get,
|
41
|
+
zoom_url("/users/#{args[:user_id]}/permissions")
|
42
|
+
).to_return(status: 404,
|
43
|
+
body: json_response('error', 'validation'),
|
44
|
+
headers: { 'Content-Type' => 'application/json' })
|
45
|
+
end
|
46
|
+
|
47
|
+
it 'raises Zoom::Error exception' do
|
48
|
+
expect { zc.user_permissions(args) }.to raise_error(Zoom::Error)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Zoom::Actions::User do
|
6
|
+
let(:zc) { zoom_client }
|
7
|
+
let(:args) { { user_id: 'eIimBAXqSrWOcB_EOIXTog' } }
|
8
|
+
|
9
|
+
describe '#user_schedulers_delete_all' do
|
10
|
+
context 'with a 204 response' do
|
11
|
+
before :each do
|
12
|
+
stub_request(
|
13
|
+
:delete,
|
14
|
+
zoom_url("/users/#{args[:user_id]}/schedulers")
|
15
|
+
).to_return(status: 204)
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'requires user_id param' do
|
19
|
+
expect do
|
20
|
+
zc.user_schedulers_delete_all(filter_key(args, :user_id))
|
21
|
+
end.to raise_error(Zoom::ParameterMissing, [:user_id].to_s)
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'returns the http status code as a number' do
|
25
|
+
expect(zc.user_schedulers_delete_all(args)).to eql(204)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
context 'with a 4xx when the user is not found' do
|
30
|
+
before :each do
|
31
|
+
stub_request(
|
32
|
+
:delete,
|
33
|
+
zoom_url("/users/#{args[:user_id]}/schedulers")
|
34
|
+
).to_return(status: 404,
|
35
|
+
body: json_response('error', 'not_found'),
|
36
|
+
headers: { 'Content-Type' => 'application/json' })
|
37
|
+
end
|
38
|
+
|
39
|
+
it 'raises an error' do
|
40
|
+
expect { zc.user_schedulers_delete_all(args) }.to raise_error(Zoom::Error)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Zoom::Actions::User do
|
6
|
+
let(:zc) { zoom_client }
|
7
|
+
let(:args) { { user_id: 'eIimBAXqSrWOcB_EOIXTog', scheduler_id: '555' } }
|
8
|
+
|
9
|
+
describe '#user_schedulers_delete' do
|
10
|
+
context 'with a 204 response' do
|
11
|
+
before :each do
|
12
|
+
stub_request(
|
13
|
+
:delete,
|
14
|
+
zoom_url("/users/#{args[:user_id]}/schedulers/#{args[:scheduler_id]}")
|
15
|
+
).to_return(status: 204)
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'requires user_id param' do
|
19
|
+
expect do
|
20
|
+
zc.user_schedulers_delete(filter_key(args, :user_id))
|
21
|
+
end.to raise_error(Zoom::ParameterMissing, [:user_id].to_s)
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'requires scheduler_id param' do
|
25
|
+
expect do
|
26
|
+
zc.user_schedulers_delete(filter_key(args, :scheduler_id))
|
27
|
+
end.to raise_error(Zoom::ParameterMissing, [:scheduler_id].to_s)
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'returns the http status code as a number' do
|
31
|
+
expect(zc.user_schedulers_delete(args)).to eql(204)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
context 'with a 4xx when the user is not found' do
|
36
|
+
before :each do
|
37
|
+
stub_request(
|
38
|
+
:delete,
|
39
|
+
zoom_url("/users/#{args[:user_id]}/schedulers/#{args[:scheduler_id]}")
|
40
|
+
).to_return(status: 404,
|
41
|
+
body: json_response('error', 'not_found'),
|
42
|
+
headers: { 'Content-Type' => 'application/json' })
|
43
|
+
end
|
44
|
+
|
45
|
+
it 'raises an error' do
|
46
|
+
expect { zc.user_schedulers_delete(args) }.to raise_error(Zoom::Error)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Zoom::Actions::User do
|
6
|
+
let(:zc) { zoom_client }
|
7
|
+
let(:args) { { user_id: 'ufR93M2pRyy8ePFN92dttq' } }
|
8
|
+
|
9
|
+
describe '#user_schedulers_list action' do
|
10
|
+
context 'with a valid response' do
|
11
|
+
before :each do
|
12
|
+
stub_request(
|
13
|
+
:get,
|
14
|
+
zoom_url("/users/#{args[:user_id]}/schedulers")
|
15
|
+
).to_return(body: json_response('user', 'scheduler', 'list'),
|
16
|
+
headers: { 'Content-Type' => 'application/json' })
|
17
|
+
end
|
18
|
+
|
19
|
+
it "requires user_id param" do
|
20
|
+
expect {
|
21
|
+
zc.user_schedulers_list(filter_key(args, :user_id))
|
22
|
+
}.to raise_error(Zoom::ParameterMissing, [:user_id].to_s)
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'returns a hash' do
|
26
|
+
expect(zc.user_schedulers_list(args)).to be_kind_of(Hash)
|
27
|
+
end
|
28
|
+
|
29
|
+
it "returns 'schedulers' count" do
|
30
|
+
expect(zc.user_schedulers_list(args)['schedulers'].count).to eq(2)
|
31
|
+
end
|
32
|
+
|
33
|
+
it "returns 'schedulers' Array" do
|
34
|
+
expect(zc.user_schedulers_list(args)['schedulers']).to be_kind_of(Array)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
context 'with a 4xx response' do
|
39
|
+
before :each do
|
40
|
+
stub_request(
|
41
|
+
:get,
|
42
|
+
zoom_url("/users/#{args[:user_id]}/schedulers")
|
43
|
+
).to_return(status: 404,
|
44
|
+
body: json_response('error', 'not_found'),
|
45
|
+
headers: { 'Content-Type' => 'application/json' })
|
46
|
+
end
|
47
|
+
|
48
|
+
it 'raises Zoom::Error exception' do
|
49
|
+
expect { zc.user_schedulers_list(args) }.to raise_error(Zoom::Error)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Zoom::Actions::User do
|
6
|
+
let(:zc) { zoom_client }
|
7
|
+
let(:args) { { id: 'ufR9342pRyf8ePFN92dttQ' } }
|
8
|
+
|
9
|
+
describe '#settings_get action' do
|
10
|
+
context 'with a valid response' do
|
11
|
+
before :each do
|
12
|
+
stub_request(
|
13
|
+
:get,
|
14
|
+
zoom_url("/users/#{args[:id]}/settings")
|
15
|
+
).to_return(status: 200,
|
16
|
+
body: json_response('user', 'settings_get'),
|
17
|
+
headers: { 'Content-Type' => 'application/json' })
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'requires id param' do
|
21
|
+
expect { zc.user_settings_get(filter_key(args, :id)) }.to raise_error(Zoom::ParameterMissing, '[:id]')
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'allowes login_type' do
|
25
|
+
args[:login_type] = 0
|
26
|
+
expect { zc.user_settings_get(args) }.not_to raise_error
|
27
|
+
end
|
28
|
+
|
29
|
+
|
30
|
+
it 'returns a hash' do
|
31
|
+
expect(zc.user_settings_get(args)).to be_kind_of(Hash)
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'returns same params' do
|
35
|
+
res = zc.user_settings_get(args)
|
36
|
+
|
37
|
+
expect(res.keys).to match_array(['scheduled_meeting', 'in_meeting', 'email_notification', 'recording', 'telephony', 'tsp', 'feature'])
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
context 'with a 4xx response' do
|
42
|
+
before :each do
|
43
|
+
stub_request(
|
44
|
+
:get,
|
45
|
+
zoom_url("/users/#{args[:id]}/settings")
|
46
|
+
).to_return(status: 404,
|
47
|
+
body: json_response('error', 'validation'),
|
48
|
+
headers: { 'Content-Type' => 'application/json' })
|
49
|
+
end
|
50
|
+
|
51
|
+
it 'raises Zoom::Error exception' do
|
52
|
+
expect { zc.user_settings_get(args) }.to raise_error(Zoom::Error)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|