zoom_markazuna 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.circleci/config.yml +66 -0
- data/.gitignore +20 -0
- data/Gemfile +5 -0
- data/Gemfile.lock +95 -0
- data/LICENSE +22 -0
- data/Makefile +5 -0
- data/README.md +65 -0
- data/lib/zoom.rb +51 -0
- data/lib/zoom/actions/account.rb +93 -0
- data/lib/zoom/actions/group.rb +8 -0
- data/lib/zoom/actions/im/chat.rb +27 -0
- data/lib/zoom/actions/im/group.rb +10 -0
- data/lib/zoom/actions/m323_device.rb +8 -0
- data/lib/zoom/actions/meeting.rb +89 -0
- data/lib/zoom/actions/metrics.rb +27 -0
- data/lib/zoom/actions/recording.rb +33 -0
- data/lib/zoom/actions/report.rb +55 -0
- data/lib/zoom/actions/user.rb +146 -0
- data/lib/zoom/actions/webinar.rb +115 -0
- data/lib/zoom/client.rb +35 -0
- data/lib/zoom/clients/jwt.rb +22 -0
- data/lib/zoom/clients/oauth.rb +17 -0
- data/lib/zoom/constants.rb +103 -0
- data/lib/zoom/error.rb +10 -0
- data/lib/zoom/interface.rb +6 -0
- data/lib/zoom/params.rb +71 -0
- data/lib/zoom/utils.rb +49 -0
- data/lib/zoom/version.rb +5 -0
- data/spec/fixtures/account/list.json +18 -0
- data/spec/fixtures/account/settings_get.json +120 -0
- data/spec/fixtures/chat/get.json +16 -0
- data/spec/fixtures/chat/list.json +16 -0
- data/spec/fixtures/error/already_exists.json +4 -0
- data/spec/fixtures/error/not_found.json +4 -0
- data/spec/fixtures/error/user_not_exist.json +4 -0
- data/spec/fixtures/error/validation.json +10 -0
- data/spec/fixtures/mc_recording_list.json +51 -0
- data/spec/fixtures/meeting/create.json +29 -0
- data/spec/fixtures/meeting/delete.json +4 -0
- data/spec/fixtures/meeting/end.json +4 -0
- data/spec/fixtures/meeting/get.json +34 -0
- data/spec/fixtures/meeting/list.json +32 -0
- data/spec/fixtures/meeting/live.json +32 -0
- data/spec/fixtures/meeting/register.json +7 -0
- data/spec/fixtures/meeting/update.json +4 -0
- data/spec/fixtures/metrics_crc.json +105 -0
- data/spec/fixtures/metrics_meetingdetail.json +32 -0
- data/spec/fixtures/metrics_meetings.json +26 -0
- data/spec/fixtures/recording_delete.json +4 -0
- data/spec/fixtures/recording_get.json +37 -0
- data/spec/fixtures/recording_list.json +51 -0
- data/spec/fixtures/report/webinar/participants.json +18 -0
- data/spec/fixtures/report_getaccountreport.json +23 -0
- data/spec/fixtures/report_getdailyreport.json +83 -0
- data/spec/fixtures/report_getuserreport.json +24 -0
- data/spec/fixtures/user/assistant/delete.json +5 -0
- data/spec/fixtures/user/assistant/set.json +5 -0
- data/spec/fixtures/user/autocreate.json +51 -0
- data/spec/fixtures/user/autocreate2.json +51 -0
- data/spec/fixtures/user/create.json +7 -0
- data/spec/fixtures/user/custcreate.json +10 -0
- data/spec/fixtures/user/delete.json +0 -0
- data/spec/fixtures/user/get.json +23 -0
- data/spec/fixtures/user/getbyemail.json +8 -0
- data/spec/fixtures/user/list.json +23 -0
- data/spec/fixtures/user/pending.json +56 -0
- data/spec/fixtures/user/permanent_delete.json +4 -0
- data/spec/fixtures/user/settings_get.json +74 -0
- data/spec/fixtures/user/update.json +0 -0
- data/spec/fixtures/webinar/create.json +29 -0
- data/spec/fixtures/webinar/delete.json +0 -0
- data/spec/fixtures/webinar/list.json +20 -0
- data/spec/fixtures/webinar/past_webinar_list.json +8 -0
- data/spec/fixtures/webinar/registrant/add.json +7 -0
- data/spec/fixtures/webinar/registrant/get.json +25 -0
- data/spec/fixtures/webinar/registrant/list.json +36 -0
- data/spec/fixtures/webinar/update.json +0 -0
- data/spec/fixtures/webinar_delete.json +4 -0
- data/spec/fixtures/webinar_end.json +4 -0
- data/spec/fixtures/webinar_get.json +17 -0
- data/spec/fixtures/webinar_update.json +4 -0
- data/spec/lib/zoom/actions/account/list_spec.rb +58 -0
- data/spec/lib/zoom/actions/account/settings_get_spec.rb +50 -0
- data/spec/lib/zoom/actions/group/create_spec.rb +3 -0
- data/spec/lib/zoom/actions/group/delete_spec.rb +3 -0
- data/spec/lib/zoom/actions/group/edit_spec.rb +3 -0
- data/spec/lib/zoom/actions/group/get_spec.rb +3 -0
- data/spec/lib/zoom/actions/group/list_spec.rb +3 -0
- data/spec/lib/zoom/actions/group/member/add_spec.rb +3 -0
- data/spec/lib/zoom/actions/group/member/delete_spec.rb +3 -0
- data/spec/lib/zoom/actions/group/member/list_spec.rb +3 -0
- data/spec/lib/zoom/actions/im/chat/get_spec.rb +64 -0
- data/spec/lib/zoom/actions/im/chat/list_spec.rb +58 -0
- data/spec/lib/zoom/actions/im/group/create_spec.rb +3 -0
- data/spec/lib/zoom/actions/im/group/delete_spec.rb +3 -0
- data/spec/lib/zoom/actions/im/group/edit_spec.rb +3 -0
- data/spec/lib/zoom/actions/im/group/get_spec.rb +3 -0
- data/spec/lib/zoom/actions/im/group/list_spec.rb +3 -0
- data/spec/lib/zoom/actions/im/group/member/add_spec.rb +3 -0
- data/spec/lib/zoom/actions/im/group/member/delete_spec.rb +3 -0
- data/spec/lib/zoom/actions/im/group/member/list_spec.rb +3 -0
- data/spec/lib/zoom/actions/m323/device/create_spec.rb +3 -0
- data/spec/lib/zoom/actions/m323/device/delete_spec.rb +3 -0
- data/spec/lib/zoom/actions/m323/device/list_spec.rb +3 -0
- data/spec/lib/zoom/actions/m323/device/update_spec.rb +3 -0
- data/spec/lib/zoom/actions/ma/account/billing_update_spec.rb +3 -0
- data/spec/lib/zoom/actions/ma/account/create_spec.rb +3 -0
- data/spec/lib/zoom/actions/ma/account/delete_spec.rb +3 -0
- data/spec/lib/zoom/actions/ma/account/get_spec.rb +3 -0
- data/spec/lib/zoom/actions/ma/account/list_spec.rb +3 -0
- data/spec/lib/zoom/actions/ma/account/plan/add_spec.rb +0 -0
- data/spec/lib/zoom/actions/ma/account/plan/get_spec.rb +0 -0
- data/spec/lib/zoom/actions/ma/account/plan/subscribe_spec.rb +3 -0
- data/spec/lib/zoom/actions/ma/account/plan/update_spec.rb +3 -0
- data/spec/lib/zoom/actions/meeting/create_spec.rb +63 -0
- data/spec/lib/zoom/actions/meeting/delete_spec.rb +55 -0
- data/spec/lib/zoom/actions/meeting/end_spec.rb +55 -0
- data/spec/lib/zoom/actions/meeting/get_spec.rb +59 -0
- data/spec/lib/zoom/actions/meeting/list_spec.rb +48 -0
- data/spec/lib/zoom/actions/meeting/live_spec.rb +43 -0
- data/spec/lib/zoom/actions/meeting/register_spec.rb +45 -0
- data/spec/lib/zoom/actions/meeting/update_spec.rb +53 -0
- data/spec/lib/zoom/actions/metrics/crc_spec.rb +48 -0
- data/spec/lib/zoom/actions/metrics/im_spec.rb +3 -0
- data/spec/lib/zoom/actions/metrics/meetingdetail_spec.rb +51 -0
- data/spec/lib/zoom/actions/metrics/meetings_spec.rb +61 -0
- data/spec/lib/zoom/actions/metrics/qos_spec.rb +3 -0
- data/spec/lib/zoom/actions/metrics/webinardetail_spec.rb +3 -0
- data/spec/lib/zoom/actions/metrics/webinars_spec.rb +3 -0
- data/spec/lib/zoom/actions/metrics/zoomroomdetail_spec.rb +3 -0
- data/spec/lib/zoom/actions/metrics/zoomrooms_spec.rb +3 -0
- data/spec/lib/zoom/actions/recording/delete_spec.rb +52 -0
- data/spec/lib/zoom/actions/recording/get_spec.rb +66 -0
- data/spec/lib/zoom/actions/recording/list_spec.rb +51 -0
- data/spec/lib/zoom/actions/recording/mc_list_spec.rb +51 -0
- data/spec/lib/zoom/actions/report/daily_report_spec.rb +0 -0
- data/spec/lib/zoom/actions/report/hosts_report_spec.rb +0 -0
- data/spec/lib/zoom/actions/report/meeting_details_report_spec.rb +0 -0
- data/spec/lib/zoom/actions/report/meeting_participants_report_spec.rb +0 -0
- data/spec/lib/zoom/actions/report/meeting_polls_report_spec.rb +0 -0
- data/spec/lib/zoom/actions/report/meetings_report_spec.rb +0 -0
- data/spec/lib/zoom/actions/report/telephone_report_spec.rb +0 -0
- data/spec/lib/zoom/actions/report/webinar_details_report_spec.rb +0 -0
- data/spec/lib/zoom/actions/report/webinar_participants_report_spec.rb +44 -0
- data/spec/lib/zoom/actions/report/webinar_polls_report_spec.rb +0 -0
- data/spec/lib/zoom/actions/report/webinar_qa_report_spec.rb +0 -0
- data/spec/lib/zoom/actions/user/activate_spec.rb +3 -0
- data/spec/lib/zoom/actions/user/assistant/delete_spec.rb +3 -0
- data/spec/lib/zoom/actions/user/assistant/set_spec.rb +3 -0
- data/spec/lib/zoom/actions/user/autocreate2_spec.rb +59 -0
- data/spec/lib/zoom/actions/user/autocreate_spec.rb +58 -0
- data/spec/lib/zoom/actions/user/checkemail_spec.rb +3 -0
- data/spec/lib/zoom/actions/user/checkzpk_spec.rb +3 -0
- data/spec/lib/zoom/actions/user/create_spec.rb +102 -0
- data/spec/lib/zoom/actions/user/custcreate_spec.rb +59 -0
- data/spec/lib/zoom/actions/user/deactivate_spec.rb +3 -0
- data/spec/lib/zoom/actions/user/delete_spec.rb +44 -0
- data/spec/lib/zoom/actions/user/get_spec.rb +54 -0
- data/spec/lib/zoom/actions/user/getbyemail_spec.rb +54 -0
- data/spec/lib/zoom/actions/user/list_spec.rb +50 -0
- data/spec/lib/zoom/actions/user/revoketoken_spec.rb +3 -0
- data/spec/lib/zoom/actions/user/settings_get_spec.rb +56 -0
- data/spec/lib/zoom/actions/user/update_spec.rb +45 -0
- data/spec/lib/zoom/actions/user/updatepassword_spec.rb +3 -0
- data/spec/lib/zoom/actions/webinar/attendees_list_spec.rb +3 -0
- data/spec/lib/zoom/actions/webinar/create_spec.rb +59 -0
- data/spec/lib/zoom/actions/webinar/delete_spec.rb +44 -0
- data/spec/lib/zoom/actions/webinar/end_spec.rb +3 -0
- data/spec/lib/zoom/actions/webinar/get_spec.rb +66 -0
- data/spec/lib/zoom/actions/webinar/list_registration_spec.rb +3 -0
- data/spec/lib/zoom/actions/webinar/list_spec.rb +50 -0
- data/spec/lib/zoom/actions/webinar/panelists_spec.rb +3 -0
- data/spec/lib/zoom/actions/webinar/past_webinar_list_spec.rb +44 -0
- data/spec/lib/zoom/actions/webinar/polls_spec.rb +3 -0
- data/spec/lib/zoom/actions/webinar/questions_spec.rb +3 -0
- data/spec/lib/zoom/actions/webinar/register_spec.rb +3 -0
- data/spec/lib/zoom/actions/webinar/registrants/add_spec.rb +64 -0
- data/spec/lib/zoom/actions/webinar/registrants/get_spec.rb +49 -0
- data/spec/lib/zoom/actions/webinar/registrants/list_spec.rb +43 -0
- data/spec/lib/zoom/actions/webinar/registrants/update_status_spec.rb +42 -0
- data/spec/lib/zoom/actions/webinar/registration_cancel_spec.rb +3 -0
- data/spec/lib/zoom/actions/webinar/registration_spec.rb +3 -0
- data/spec/lib/zoom/actions/webinar/update_spec.rb +44 -0
- data/spec/lib/zoom/actions/webinar/uuid_list_spec.rb +3 -0
- data/spec/lib/zoom/client_spec.rb +76 -0
- data/spec/lib/zoom/params_spec.rb +81 -0
- data/spec/lib/zoom/utils_spec.rb +48 -0
- data/spec/spec_helper.rb +43 -0
- data/zoom_rb.gemspec +33 -0
- metadata +518 -0
@@ -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) { { id: 'eIimBAXqSrWOcB_EOIXTog' } }
|
8
|
+
|
9
|
+
describe '#user_delete' do
|
10
|
+
context 'with a 204 response' do
|
11
|
+
before :each do
|
12
|
+
stub_request(
|
13
|
+
:delete,
|
14
|
+
zoom_url("/users/#{args[:id]}")
|
15
|
+
).to_return(status: 204,
|
16
|
+
body: json_response('user', 'delete'),
|
17
|
+
headers: { 'Content-Type' => 'application/json' })
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'requires id param' do
|
21
|
+
expect { zc.user_delete(filter_key(args, :id)) }.to raise_error(Zoom::ParameterMissing, [:id].to_s)
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'returns the http status code as a number' do
|
25
|
+
expect(zc.user_delete(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[:id]}")
|
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_delete(args) }.to raise_error(Zoom::Error)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,54 @@
|
|
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_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]}")
|
15
|
+
).to_return(status: 200,
|
16
|
+
body: json_response('user', 'get'),
|
17
|
+
headers: { 'Content-Type' => 'application/json' })
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'requires id param' do
|
21
|
+
expect { zc.user_get(filter_key(args, :id)) }.to raise_error(Zoom::ParameterMissing, '[:id]')
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'returns a hash' do
|
25
|
+
expect(zc.user_get(args)).to be_kind_of(Hash)
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'returns same params' do
|
29
|
+
res = zc.user_get(args)
|
30
|
+
|
31
|
+
expect(res['id']).to eq(args[:id])
|
32
|
+
expect(res).to have_key('first_name')
|
33
|
+
expect(res).to have_key('last_name')
|
34
|
+
expect(res).to have_key('email')
|
35
|
+
expect(res).to have_key('type')
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
context 'with a 4xx response' do
|
40
|
+
before :each do
|
41
|
+
stub_request(
|
42
|
+
:get,
|
43
|
+
zoom_url("/users/#{args[:id]}")
|
44
|
+
).to_return(status: 404,
|
45
|
+
body: json_response('error', 'validation'),
|
46
|
+
headers: { 'Content-Type' => 'application/json' })
|
47
|
+
end
|
48
|
+
|
49
|
+
it 'raises Zoom::Error exception' do
|
50
|
+
expect { zc.user_get(args) }.to raise_error(Zoom::Error)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
xdescribe Zoom::Actions::User do
|
6
|
+
|
7
|
+
before :all do
|
8
|
+
@zc = zoom_client
|
9
|
+
@args = { email: 'foo@bar.com',
|
10
|
+
login_type: 99 }
|
11
|
+
end
|
12
|
+
|
13
|
+
xdescribe '#user_getbyemail action' do
|
14
|
+
before :each do
|
15
|
+
stub_request(
|
16
|
+
:post,
|
17
|
+
zoom_url('/user/getbyemail')
|
18
|
+
).to_return(body: json_response('user', 'getbyemail'))
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'requires email param' do
|
22
|
+
expect { @zc.user_getbyemail(filter_key(@args, :email)) }.to raise_error(ArgumentError)
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'returns a hash' do
|
26
|
+
expect(@zc.user_getbyemail(@args)).to be_kind_of(Hash)
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'returns same params' do
|
30
|
+
res = @zc.user_getbyemail(@args)
|
31
|
+
|
32
|
+
expect(res).to have_key('id')
|
33
|
+
expect(res).to have_key('first_name')
|
34
|
+
expect(res).to have_key('last_name')
|
35
|
+
expect(res['email']).to eq(@args[:email])
|
36
|
+
expect(res['type']).to eq(@args[:login_type])
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
xdescribe '#user_getbyemail! action' do
|
41
|
+
before :each do
|
42
|
+
stub_request(
|
43
|
+
:post,
|
44
|
+
zoom_url('/user/getbyemail')
|
45
|
+
).to_return(body: json_response('error'))
|
46
|
+
end
|
47
|
+
|
48
|
+
it 'raises Zoom::Error exception' do
|
49
|
+
expect {
|
50
|
+
@zc.user_getbyemail!(@args)
|
51
|
+
}.to raise_error(Zoom::Error)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
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
|
+
|
8
|
+
describe '#user_list action' do
|
9
|
+
context 'with a valid response' do
|
10
|
+
before :each do
|
11
|
+
stub_request(
|
12
|
+
:get,
|
13
|
+
zoom_url('/users')
|
14
|
+
).to_return(body: json_response('user', 'list'),
|
15
|
+
headers: { 'Content-Type' => 'application/json' })
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'returns a hash' do
|
19
|
+
expect(zc.user_list).to be_kind_of(Hash)
|
20
|
+
end
|
21
|
+
|
22
|
+
it "returns 'total_records" do
|
23
|
+
expect(zc.user_list['total_records']).to eq(1)
|
24
|
+
end
|
25
|
+
|
26
|
+
it "returns 'users' Array" do
|
27
|
+
expect(zc.user_list['users']).to be_kind_of(Array)
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'raises an error when passed an invalid option' do
|
31
|
+
expect { zc.user_list(foo: 'bar', status: 'active') }.to raise_error(Zoom::ParameterNotPermitted, [:foo].to_s)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
context 'with a 4xx response' do
|
36
|
+
before :each do
|
37
|
+
stub_request(
|
38
|
+
:get,
|
39
|
+
zoom_url('/users')
|
40
|
+
).to_return(status: 404,
|
41
|
+
body: json_response('error', 'not_found'),
|
42
|
+
headers: { 'Content-Type' => 'application/json' })
|
43
|
+
end
|
44
|
+
|
45
|
+
it 'raises Zoom::Error exception' do
|
46
|
+
expect { zc.user_list }.to raise_error(Zoom::Error)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
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
|
@@ -0,0 +1,45 @@
|
|
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: 'eIimBAXqSrWOcB_EOIXTog',
|
8
|
+
first_name: 'Bar',
|
9
|
+
last_name: 'Foo' } }
|
10
|
+
|
11
|
+
describe '#user_update' do
|
12
|
+
context 'with a valid response' do
|
13
|
+
before :each do
|
14
|
+
stub_request(
|
15
|
+
:patch,
|
16
|
+
zoom_url("/users/#{args[:id]}")
|
17
|
+
).to_return(status: 204,
|
18
|
+
body: json_response('user', 'update'),
|
19
|
+
headers: { 'Content-Type' => 'application/json' })
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'requires id param' do
|
23
|
+
expect { zc.user_update(filter_key(args, :id)) }.to raise_error(Zoom::ParameterMissing, [:id].to_s)
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'returns the http status code as a number' do
|
27
|
+
expect(zc.user_update(args)).to eql(204)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
context 'with a 4xx response' do
|
31
|
+
before :each do
|
32
|
+
stub_request(
|
33
|
+
:patch,
|
34
|
+
zoom_url("/users/#{args[:id]}")
|
35
|
+
).to_return(status: 404,
|
36
|
+
body: json_response('error', 'validation'),
|
37
|
+
headers: { 'Content-Type' => 'application/json' })
|
38
|
+
end
|
39
|
+
|
40
|
+
it 'raises an error' do
|
41
|
+
expect { zc.user_update(args) }.to raise_error(Zoom::Error)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
RSpec.describe Zoom::Actions::Webinar do
|
6
|
+
|
7
|
+
[:jwt_client, :oauth_client].each do |client|
|
8
|
+
describe "#{client}" do
|
9
|
+
let(:zc) { send(client) }
|
10
|
+
let(:args) { { host_id: 'test_user_id' } }
|
11
|
+
|
12
|
+
describe '#webinar_create' do
|
13
|
+
context 'with a valid response' do
|
14
|
+
before :each do
|
15
|
+
stub_request(
|
16
|
+
:post,
|
17
|
+
zoom_url("/users/#{args[:host_id]}/webinars")
|
18
|
+
).to_return(body: json_response('webinar', 'create'),
|
19
|
+
headers: { 'Content-Type' => 'application/json' })
|
20
|
+
end
|
21
|
+
|
22
|
+
it "requires a 'host_id' argument" do
|
23
|
+
expect { zc.webinar_create(filter_key(args, :host_id)) }.to raise_error(Zoom::ParameterMissing, [:host_id].to_s)
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'returns a hash' do
|
27
|
+
expect(zc.webinar_create(args)).to be_kind_of(Hash)
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'returns the setted params' do
|
31
|
+
res = zc.webinar_create(args)
|
32
|
+
expect(res['host_id']).to eq(args[:host_id])
|
33
|
+
end
|
34
|
+
|
35
|
+
it "returns 'start_url' and 'join_url'" do
|
36
|
+
res = zc.webinar_create(args)
|
37
|
+
|
38
|
+
expect(res['start_url']).to_not be_nil
|
39
|
+
expect(res['join_url']).to_not be_nil
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
context 'with a 4xx response' do
|
44
|
+
before :each do
|
45
|
+
stub_request(
|
46
|
+
:post,
|
47
|
+
zoom_url("/users/#{args[:host_id]}/webinars")
|
48
|
+
).to_return(body: json_response('error', 'validation'),
|
49
|
+
headers: { 'Content-Type' => 'application/json' })
|
50
|
+
end
|
51
|
+
|
52
|
+
it 'raises Zoom::Error exception' do
|
53
|
+
expect { zc.webinar_create(args) }.to raise_error(Zoom::Error)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Zoom::Actions::Webinar do
|
6
|
+
let(:zc) { zoom_client }
|
7
|
+
let(:args) { { id: '123456789' } }
|
8
|
+
|
9
|
+
describe '#webinar_delete' do
|
10
|
+
context 'with a valid response' do
|
11
|
+
before :each do
|
12
|
+
stub_request(
|
13
|
+
:delete,
|
14
|
+
zoom_url("/webinars/#{args[:id]}")
|
15
|
+
).to_return(status: 204,
|
16
|
+
body: json_response('webinar', 'delete'),
|
17
|
+
headers: { 'Content-Type' => 'application/json' })
|
18
|
+
end
|
19
|
+
|
20
|
+
it "requires a 'id' argument" do
|
21
|
+
expect { zc.webinar_delete(filter_key(args, :id)) }.to raise_error(Zoom::ParameterMissing, [:id].to_s)
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'returns the http status code as a number' do
|
25
|
+
expect(zc.webinar_delete(args)).to eql(204)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
context 'with a 4xx response' do
|
30
|
+
before :each do
|
31
|
+
stub_request(
|
32
|
+
:delete,
|
33
|
+
zoom_url("/webinars/#{args[:id]}")
|
34
|
+
).to_return(status: 404,
|
35
|
+
body: json_response('error', 'validation'),
|
36
|
+
headers: { 'Content-Type' => 'application/json' })
|
37
|
+
end
|
38
|
+
|
39
|
+
it 'raises Zoom::Error exception' do
|
40
|
+
expect { zc.webinar_delete(args) }.to raise_error(Zoom::Error)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
xdescribe Zoom::Actions::Webinar do
|
6
|
+
|
7
|
+
before :all do
|
8
|
+
@zc = zoom_client
|
9
|
+
@args = {
|
10
|
+
host_id: 'dh23hdu23gd',
|
11
|
+
id: '123456789'
|
12
|
+
}
|
13
|
+
end
|
14
|
+
|
15
|
+
xdescribe '#webinar_get action' do
|
16
|
+
before :each do
|
17
|
+
stub_request(
|
18
|
+
:post,
|
19
|
+
zoom_url('/webinar/get')
|
20
|
+
).to_return(body: json_response('webinar_get'),
|
21
|
+
headers: { 'Content-Type' => 'application/json' })
|
22
|
+
end
|
23
|
+
|
24
|
+
it "requires a 'host_id' argument" do
|
25
|
+
expect {
|
26
|
+
@zc.meeting_create(filter_key(@args, :host_id))
|
27
|
+
}.to raise_error(ArgumentError)
|
28
|
+
end
|
29
|
+
|
30
|
+
it "requires a 'id' argument" do
|
31
|
+
expect {
|
32
|
+
@zc.meeting_create(filter_key(@args, :id))
|
33
|
+
}.to raise_error(ArgumentError)
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'returns a hash' do
|
37
|
+
expect(@zc.webinar_get(@args)).to be_kind_of(Hash)
|
38
|
+
end
|
39
|
+
|
40
|
+
it 'returns id and attributes' do
|
41
|
+
res = @zc.webinar_get(@args)
|
42
|
+
|
43
|
+
expect(res['id']).to eq(@args[:id])
|
44
|
+
expect(res['host_id']).to eq(@args[:host_id])
|
45
|
+
expect(res['topic']).to eq('Topic for this meeting')
|
46
|
+
expect(res['start_time']).to eq('2012-11-25T12:00:00Z')
|
47
|
+
expect(res['join_url']).to eq('https://zoom.us/j/123456789')
|
48
|
+
expect(res['start_url']).to eq('https://zoom.us/s/123456789?zpk=hs65q23kd9sqliy612h23k')
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
xdescribe '#webinar_get! action' do
|
53
|
+
before :each do
|
54
|
+
stub_request(
|
55
|
+
:post,
|
56
|
+
zoom_url('/webinar/get')
|
57
|
+
).to_return(body: json_response('error'))
|
58
|
+
end
|
59
|
+
|
60
|
+
it 'raises Zoom::Error exception' do
|
61
|
+
expect {
|
62
|
+
@zc.webinar_get!(@args)
|
63
|
+
}.to raise_error(Zoom::Error)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|