zoom_rb 0.8.1
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 +64 -0
- data/.gitignore +19 -0
- data/.ruby-version +1 -0
- data/Gemfile +5 -0
- data/Gemfile.lock +91 -0
- data/LICENSE +22 -0
- data/Makefile +5 -0
- data/README.md +51 -0
- data/lib/zoom.rb +49 -0
- data/lib/zoom/actions/account.rb +93 -0
- data/lib/zoom/actions/group.rb +8 -0
- data/lib/zoom/actions/im/chat.rb +29 -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 +80 -0
- data/lib/zoom/actions/metrics.rb +29 -0
- data/lib/zoom/actions/recording.rb +35 -0
- data/lib/zoom/actions/report.rb +29 -0
- data/lib/zoom/actions/user.rb +146 -0
- data/lib/zoom/actions/webinar.rb +110 -0
- data/lib/zoom/client.rb +36 -0
- data/lib/zoom/defaults.rb +96 -0
- data/lib/zoom/error.rb +9 -0
- data/lib/zoom/interface.rb +6 -0
- data/lib/zoom/params.rb +64 -0
- data/lib/zoom/utils.rb +74 -0
- data/spec/fixtures/chat/get.json +16 -0
- data/spec/fixtures/chat/list.json +16 -0
- data/spec/fixtures/error/validation.json +10 -0
- data/spec/fixtures/mc_recording_list.json +51 -0
- data/spec/fixtures/meeting/create.json +24 -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/getaccountreport.json +23 -0
- data/spec/fixtures/report/getaudioreport.json +22 -0
- data/spec/fixtures/report/getdailyreport.json +13 -0
- data/spec/fixtures/report/getuserreport.json +24 -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/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/registrant/add.json +7 -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/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 +66 -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/getaccountreport_spec.rb +57 -0
- data/spec/lib/zoom/actions/report/getaudioreport_spec.rb +3 -0
- data/spec/lib/zoom/actions/report/getdailyreport_spec.rb +62 -0
- data/spec/lib/zoom/actions/report/getuserreport_spec.rb +67 -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 +69 -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 +40 -0
- data/spec/lib/zoom/actions/user/get_spec.rb +50 -0
- data/spec/lib/zoom/actions/user/getbyemail_spec.rb +54 -0
- data/spec/lib/zoom/actions/user/list_spec.rb +47 -0
- data/spec/lib/zoom/actions/user/revoketoken_spec.rb +3 -0
- data/spec/lib/zoom/actions/user/update_spec.rb +40 -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 +52 -0
- data/spec/lib/zoom/actions/webinar/delete_spec.rb +40 -0
- data/spec/lib/zoom/actions/webinar/end_spec.rb +3 -0
- data/spec/lib/zoom/actions/webinar/get_spec.rb +65 -0
- data/spec/lib/zoom/actions/webinar/list_registration_spec.rb +3 -0
- data/spec/lib/zoom/actions/webinar/list_spec.rb +48 -0
- data/spec/lib/zoom/actions/webinar/panelists_spec.rb +3 -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 +60 -0
- data/spec/lib/zoom/actions/webinar/registrants/approve_spec.rb +3 -0
- data/spec/lib/zoom/actions/webinar/registrants/list_spec.rb +40 -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 +40 -0
- data/spec/lib/zoom/actions/webinar/uuid_list_spec.rb +3 -0
- data/spec/lib/zoom/client_spec.rb +45 -0
- data/spec/lib/zoom/params_spec.rb +68 -0
- data/spec/lib/zoom/utils_spec.rb +73 -0
- data/spec/spec_helper.rb +35 -0
- data/zoom_rb.gemspec +29 -0
- metadata +483 -0
@@ -0,0 +1,52 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
xdescribe Zoom::Actions::Recording do
|
6
|
+
|
7
|
+
before :all do
|
8
|
+
@zc = zoom_client
|
9
|
+
@args = { meeting_id: 'ucc69C82Q5mTNyCRWE29Aw==' }
|
10
|
+
end
|
11
|
+
|
12
|
+
xdescribe '#recording_delete action' do
|
13
|
+
before :each do
|
14
|
+
stub_request(
|
15
|
+
:post,
|
16
|
+
zoom_url('/recording/delete')
|
17
|
+
).to_return(body: json_response('recording_delete'))
|
18
|
+
end
|
19
|
+
|
20
|
+
it "requires a 'meeting_id' argument" do
|
21
|
+
expect {
|
22
|
+
@zc.recording_delete(filter_key(@args, :meeting_id))
|
23
|
+
}.to raise_error(ArgumentError)
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'returns a hash' do
|
27
|
+
expect(@zc.recording_delete(@args)).to be_kind_of(Hash)
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'returns id and deleted at attributes' do
|
31
|
+
res = @zc.recording_delete(@args)
|
32
|
+
|
33
|
+
expect(res['id']).to eq(@args[:meeting_id])
|
34
|
+
expect(res['deleted_at']).to eq('2012-11-25T12:00:00Z')
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
xdescribe '#recording_delete! action' do
|
39
|
+
before :each do
|
40
|
+
stub_request(
|
41
|
+
:post,
|
42
|
+
zoom_url('/recording/delete')
|
43
|
+
).to_return(body: json_response('error'))
|
44
|
+
end
|
45
|
+
|
46
|
+
it 'raises Zoom::Error exception' do
|
47
|
+
expect {
|
48
|
+
@zc.recording_delete!(@args)
|
49
|
+
}.to raise_error(Zoom::Error)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
xdescribe Zoom::Actions::Recording do
|
6
|
+
|
7
|
+
before :all do
|
8
|
+
@zc = zoom_client
|
9
|
+
@args = {
|
10
|
+
meeting_id: 'ucc69C82Q5mTNyCRWE29Aw=='
|
11
|
+
}
|
12
|
+
end
|
13
|
+
|
14
|
+
xdescribe '#recording_get action' do
|
15
|
+
before :each do
|
16
|
+
stub_request(
|
17
|
+
:post,
|
18
|
+
zoom_url('/recording/get')
|
19
|
+
).to_return(body: json_response('recording_get'))
|
20
|
+
end
|
21
|
+
|
22
|
+
it "requires a 'meeting_id' argument" do
|
23
|
+
expect {
|
24
|
+
@zc.meeting_create(filter_key(@args, :meeting_id))
|
25
|
+
}.to raise_error(ArgumentError)
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'returns a hash' do
|
29
|
+
expect(@zc.recording_get(@args)).to be_kind_of(Hash)
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'returns id and attributes' do
|
33
|
+
res = @zc.recording_get(@args)
|
34
|
+
|
35
|
+
expect(res['uuid']).to eq(@args[:meeting_id])
|
36
|
+
expect(res['meeting_number']).to eq(933560800)
|
37
|
+
expect(res['host_id']).to eq('kEFomHcIRgqxZT8D086O6A')
|
38
|
+
expect(res['account_id']).to eq('NyEqCEoYSNOr4jLMHoO2tA')
|
39
|
+
expect(res['topic']).to eq('vgfdsffdfdsf s3423432')
|
40
|
+
expect(res['start_time']).to eq('2015-04-13T01:06:04Z')
|
41
|
+
expect(res['timezone']).to eq('UTC')
|
42
|
+
expect(res['duration']).to eq(1)
|
43
|
+
expect(res['total_size']).to eq(686496)
|
44
|
+
expect(res['recording_count']).to eq(3)
|
45
|
+
end
|
46
|
+
|
47
|
+
it "returns 'recording_files' Array" do
|
48
|
+
expect(@zc.recording_get(@args)['recording_files']).to be_kind_of(Array)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
xdescribe '#recording_get! action' do
|
53
|
+
before :each do
|
54
|
+
stub_request(
|
55
|
+
:post,
|
56
|
+
zoom_url('/recording/get')
|
57
|
+
).to_return(body: json_response('error'))
|
58
|
+
end
|
59
|
+
|
60
|
+
it 'raises Zoom::Error exception' do
|
61
|
+
expect {
|
62
|
+
@zc.recording_get!(@args)
|
63
|
+
}.to raise_error(Zoom::Error)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
xdescribe Zoom::Actions::Recording do
|
6
|
+
|
7
|
+
before :all do
|
8
|
+
@zc = zoom_client
|
9
|
+
@args = { host_id: 'kEFomHcIRgqxZT8D086O6A' }
|
10
|
+
end
|
11
|
+
|
12
|
+
xdescribe '#recording_list action' do
|
13
|
+
before :each do
|
14
|
+
stub_request(
|
15
|
+
:post,
|
16
|
+
zoom_url('/recording/list')
|
17
|
+
).to_return(body: json_response('recording_list'))
|
18
|
+
end
|
19
|
+
|
20
|
+
it "requires a 'host_id' argument" do
|
21
|
+
expect { @zc.recording_list }.to raise_error(ArgumentError)
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'returns a hash' do
|
25
|
+
expect(@zc.recording_list(@args)).to be_kind_of(Hash)
|
26
|
+
end
|
27
|
+
|
28
|
+
it "returns 'total_records'" do
|
29
|
+
expect(@zc.recording_list(@args)['total_records']).to eq(1)
|
30
|
+
end
|
31
|
+
|
32
|
+
it "returns 'meetings' Array" do
|
33
|
+
expect(@zc.recording_list(@args)['meetings']).to be_kind_of(Array)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
xdescribe '#recording_list! action' do
|
38
|
+
before :each do
|
39
|
+
stub_request(
|
40
|
+
:post,
|
41
|
+
zoom_url('/recording/list')
|
42
|
+
).to_return(body: json_response('error'))
|
43
|
+
end
|
44
|
+
|
45
|
+
it 'raises Zoom::Error exception' do
|
46
|
+
expect {
|
47
|
+
@zc.recording_list!(@args)
|
48
|
+
}.to raise_error(Zoom::Error)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
xdescribe Zoom::Actions::Recording do
|
6
|
+
|
7
|
+
before :all do
|
8
|
+
@zc = zoom_client
|
9
|
+
@args = { host_id: 'kEFomHcIRgqxZT8D086O6A' }
|
10
|
+
end
|
11
|
+
|
12
|
+
xdescribe '#mc_recording_list action' do
|
13
|
+
before :each do
|
14
|
+
stub_request(
|
15
|
+
:post,
|
16
|
+
zoom_url('/mc/recording/list')
|
17
|
+
).to_return(body: json_response('mc_recording_list'))
|
18
|
+
end
|
19
|
+
|
20
|
+
it "requires a 'host_id' argument" do
|
21
|
+
expect { @zc.mc_recording_list }.to raise_error(ArgumentError)
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'returns a hash' do
|
25
|
+
expect(@zc.mc_recording_list(@args)).to be_kind_of(Hash)
|
26
|
+
end
|
27
|
+
|
28
|
+
it "returns 'total_records'" do
|
29
|
+
expect(@zc.mc_recording_list(@args)['total_records']).to eq(1)
|
30
|
+
end
|
31
|
+
|
32
|
+
it "returns 'meetings' Array" do
|
33
|
+
expect(@zc.mc_recording_list(@args)['meetings']).to be_kind_of(Array)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
xdescribe '#mc_recording_list! action' do
|
38
|
+
before :each do
|
39
|
+
stub_request(
|
40
|
+
:post,
|
41
|
+
zoom_url('/mc/recording/list')
|
42
|
+
).to_return(body: json_response('error'))
|
43
|
+
end
|
44
|
+
|
45
|
+
it 'raises Zoom::Error exception' do
|
46
|
+
expect {
|
47
|
+
@zc.mc_recording_list!(@args)
|
48
|
+
}.to raise_error(Zoom::Error)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
xdescribe Zoom::Actions::Report do
|
6
|
+
let(:zc) { zoom_client}
|
7
|
+
let(:args) { { from: '2013-04-05T15:50:47Z', to: '2013-04-09T19:00:00Z' } }
|
8
|
+
let(:response) { zc.report_getaccountreport(args) }
|
9
|
+
|
10
|
+
xdescribe '#report_getaccountreport action' do
|
11
|
+
before :each do
|
12
|
+
stub_request(
|
13
|
+
:post,
|
14
|
+
zoom_url('/report/getaccountreport')
|
15
|
+
).to_return(body: json_response('report_getaccountreport'))
|
16
|
+
end
|
17
|
+
|
18
|
+
it "requires a 'from' argument" do
|
19
|
+
expect {
|
20
|
+
zc.report_getaccountreport(filter_key(args, :from))
|
21
|
+
}.to raise_error(ArgumentError)
|
22
|
+
end
|
23
|
+
|
24
|
+
it "requires a 'to' argument" do
|
25
|
+
expect {
|
26
|
+
zc.report_getaccountreport(filter_key(args, :to))
|
27
|
+
}.to raise_error(ArgumentError)
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'returns a hash' do
|
31
|
+
expect(response).to be_kind_of(Hash)
|
32
|
+
end
|
33
|
+
|
34
|
+
it "returns 'total_records'" do
|
35
|
+
expect(response['total_records']).to eq(1)
|
36
|
+
end
|
37
|
+
|
38
|
+
it "returns 'users' Array" do
|
39
|
+
expect(response['users']).to be_kind_of(Array)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
xdescribe '#report_getaccountreport! action' do
|
44
|
+
before :each do
|
45
|
+
stub_request(
|
46
|
+
:post,
|
47
|
+
zoom_url('/report/getaccountreport')
|
48
|
+
).to_return(body: json_response('error'))
|
49
|
+
end
|
50
|
+
|
51
|
+
it 'raises Zoom::Error exception' do
|
52
|
+
expect {
|
53
|
+
zc.report_getaccountreport!(args)
|
54
|
+
}.to raise_error(Zoom::Error)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
xdescribe Zoom::Actions::Report do
|
6
|
+
before :all do
|
7
|
+
@zc = zoom_client
|
8
|
+
@args = { year: 2017, month: 7 }
|
9
|
+
end
|
10
|
+
|
11
|
+
xdescribe '#report_getdailyreport action' do
|
12
|
+
before :each do
|
13
|
+
stub_request(
|
14
|
+
:post,
|
15
|
+
zoom_url('/report/getdailyreport')
|
16
|
+
).to_return(body: json_response('report_getdailyreport'))
|
17
|
+
end
|
18
|
+
|
19
|
+
it "requires a 'year' argument" do
|
20
|
+
expect {
|
21
|
+
@zc.report_getdailyreport(filter_key(@args, :year))
|
22
|
+
}.to raise_error(ArgumentError)
|
23
|
+
end
|
24
|
+
|
25
|
+
it "requires a 'month' argument" do
|
26
|
+
expect {
|
27
|
+
@zc.report_getdailyreport(filter_key(@args, :month))
|
28
|
+
}.to raise_error(ArgumentError)
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'returs a Hash' do
|
32
|
+
expect(@zc.report_getdailyreport(@args)).to be_kind_of(Hash)
|
33
|
+
end
|
34
|
+
|
35
|
+
it "returns a 'year'" do
|
36
|
+
expect(@zc.report_getdailyreport(@args)['year']).to eq(@args[:year])
|
37
|
+
end
|
38
|
+
|
39
|
+
it "returns a 'month'" do
|
40
|
+
expect(@zc.report_getdailyreport(@args)['month']).to eq(@args[:month])
|
41
|
+
end
|
42
|
+
|
43
|
+
it "returns a 'dates' Array" do
|
44
|
+
expect(@zc.report_getdailyreport(@args)['dates']).to be_kind_of(Array)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
xdescribe '#report_getdailyreport! action' do
|
49
|
+
before :each do
|
50
|
+
stub_request(
|
51
|
+
:post,
|
52
|
+
zoom_url('/report/getdailyreport')
|
53
|
+
).to_return(body: json_response('error'))
|
54
|
+
end
|
55
|
+
|
56
|
+
it 'raises Zoom::Error exception' do
|
57
|
+
expect {
|
58
|
+
@zc.report_getdailyreport!(@args)
|
59
|
+
}.to raise_error(Zoom::Error)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
xdescribe Zoom::Actions::Report do
|
6
|
+
|
7
|
+
before :all do
|
8
|
+
@zc = zoom_client
|
9
|
+
@args = { from: '2013-04-05T15:50:47Z',
|
10
|
+
to: '2013-04-09T19:00:00Z',
|
11
|
+
user_id: 'ufR93M2pRyy8ePFN92dttq' }
|
12
|
+
end
|
13
|
+
|
14
|
+
xdescribe '#report_getuserreport action' do
|
15
|
+
before :each do
|
16
|
+
stub_request(
|
17
|
+
:post,
|
18
|
+
zoom_url('/report/getuserreport')
|
19
|
+
).to_return(body: json_response('report_getuserreport'))
|
20
|
+
end
|
21
|
+
|
22
|
+
it "requires a 'user_id' argument" do
|
23
|
+
expect {
|
24
|
+
@zc.report_getuserreport(filter_key(@args, :user_id))
|
25
|
+
}.to raise_error(ArgumentError)
|
26
|
+
end
|
27
|
+
|
28
|
+
it "requires a 'from' argument" do
|
29
|
+
expect {
|
30
|
+
@zc.report_getuserreport(filter_key(@args, :from))
|
31
|
+
}.to raise_error(ArgumentError)
|
32
|
+
end
|
33
|
+
|
34
|
+
it "requires a 'to' argument" do
|
35
|
+
expect {
|
36
|
+
@zc.report_getuserreport(filter_key(@args, :to))
|
37
|
+
}.to raise_error(ArgumentError)
|
38
|
+
end
|
39
|
+
|
40
|
+
it 'returns a hash' do
|
41
|
+
expect(@zc.report_getuserreport(@args)).to be_kind_of(Hash)
|
42
|
+
end
|
43
|
+
|
44
|
+
it "returns 'total_records'" do
|
45
|
+
expect(@zc.report_getuserreport(@args)['total_records']).to eq(1)
|
46
|
+
end
|
47
|
+
|
48
|
+
it "returns 'meetings' Array" do
|
49
|
+
expect(@zc.report_getuserreport(@args)['meetings']).to be_kind_of(Array)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
xdescribe '#report_getuserreport! action' do
|
54
|
+
before :each do
|
55
|
+
stub_request(
|
56
|
+
:post,
|
57
|
+
zoom_url('/report/getuserreport')
|
58
|
+
).to_return(body: json_response('error'))
|
59
|
+
end
|
60
|
+
|
61
|
+
it 'raises Zoom::Error exception' do
|
62
|
+
expect {
|
63
|
+
@zc.report_getuserreport!(@args)
|
64
|
+
}.to raise_error(Zoom::Error)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
xdescribe Zoom::Actions::User do
|
4
|
+
let(:zc) { zoom_client }
|
5
|
+
let(:args) { { email: 'foo@bar.com',
|
6
|
+
password: 'somepassword123',
|
7
|
+
first_name: 'Zoomie',
|
8
|
+
last_name: 'Userton',
|
9
|
+
type: 1 } }
|
10
|
+
let(:response) { zc.user_autocreate2(args) }
|
11
|
+
|
12
|
+
xdescribe '#user_autocreate2 action' do
|
13
|
+
before :each do
|
14
|
+
stub_request(
|
15
|
+
:post,
|
16
|
+
zoom_url('/user/autocreate2')
|
17
|
+
).to_return(body: json_response('user', 'autocreate2'))
|
18
|
+
# the api for autocreate2 is basically all the same
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'requires email param' do
|
22
|
+
expect { zc.user_autocreate2(filter_key(args, :email)) }.to raise_error(ArgumentError)
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'requires type param' do
|
26
|
+
expect { zc.user_autocreate2(filter_key(args, :type)) }.to raise_error(ArgumentError)
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'requires password param' do
|
30
|
+
expect{ zc.user_autocreate2(filter_key(args, :password)) }.to raise_error(ArgumentError)
|
31
|
+
end
|
32
|
+
|
33
|
+
it 'returns a hash' do
|
34
|
+
expect(response).to be_kind_of(Hash)
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'returns same params' do
|
38
|
+
expect(response['email']).to eq(args[:email])
|
39
|
+
expect(response['first_name']).to eq(args[:first_name])
|
40
|
+
expect(response['last_name']).to eq(args[:last_name])
|
41
|
+
expect(response['type']).to eq(args[:type])
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
xdescribe '#user_autocreate2! action' do
|
46
|
+
before :each do
|
47
|
+
stub_request(
|
48
|
+
:post,
|
49
|
+
zoom_url('/user/autocreate2')
|
50
|
+
).to_return(body: json_response('error'))
|
51
|
+
end
|
52
|
+
|
53
|
+
it 'raises Zoomus::Error exception' do
|
54
|
+
expect {
|
55
|
+
zc.user_autocreate2!(args)
|
56
|
+
}.to raise_error(Zoom::Error)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|