zoom_rb 0.9.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 711b71ce15443f695b228ee36d51501e18b2b5132ab3b2c473d1d8300ea64720
4
- data.tar.gz: 4f967a6b7e73adc1450d7ea51defb7380fa6c660c83922a01ba696f91950a25f
3
+ metadata.gz: ad16279c225cd1874a9923203eafd25dce7b8f122cb9f5abf2cb5126e2792ef6
4
+ data.tar.gz: 34fbf4d1a4a4d5dbf02c32cc994ea6eaacdee90b613f70a29d573d9b451e3d3a
5
5
  SHA512:
6
- metadata.gz: 7d57f4998d48c7999a9a404688120312173d5c613a82069717ffd414dd8ad744dc1695e085436160fc7deb96350a86e689d053fea94ed6eeec0225ac77fd5ead
7
- data.tar.gz: eff852b6a1012dd45186560406d5afeb98ae77aa8a41d43c663ca1edfde5fd2f5bced5512fea05a71b1be7f14c681fdde51824009773ec468130dda437622f3b
6
+ metadata.gz: f392deada6b8e9e7ff03007d295ec97981958a14a1ca6b45cfd4ade5ce6cf7445c6603e899a548d3aef5ff904f02e91138a4bd28ea47da7dd892f3fff9a6d566
7
+ data.tar.gz: 18f7a36b1f5af0073a87cf66ddfb5ee03bb5bfe1b1be6635a39cd493ec6d82b775e14d6979bbd0aa02c20065bfc70b42575ce944e786ae3cf3bbb68ab4b3b317
data/.gitignore CHANGED
@@ -16,4 +16,5 @@ test/version_tmp
16
16
  tmp
17
17
  build_and_publish
18
18
  .rubocop*
19
- .DS_Store
19
+ .DS_Store
20
+ .ruby-version
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- zoom_rb (0.8.6)
4
+ zoom_rb (0.8.7)
5
5
  httparty (~> 0.13)
6
6
  json (>= 1.8)
7
7
  jwt
@@ -100,9 +100,9 @@ module Zoom
100
100
  end
101
101
 
102
102
  def past_webinar_list(*args)
103
- # TODO: implement past_webinars_list
104
- # options = Utils.extract_options!(args)
105
- raise Zoom::NotImplemented, 'past_webinars_list is not yet implemented'
103
+ params = Zoom::Params.new(Utils.extract_options!(args))
104
+ params.require(:id)
105
+ Utils.parse_response self.class.get("/past_webinars/#{params[:id]}/instances", headers: request_headers)
106
106
  end
107
107
  end
108
108
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Zoom
4
- VERSION = '0.9.0'
4
+ VERSION = '0.9.1'
5
5
  end
@@ -0,0 +1,8 @@
1
+ {
2
+ "webinars": [
3
+ {
4
+ "uuid": "ABCDEFGHIJKLMNOPQRSTUV==",
5
+ "start_time": "2019-01-01T10:00:00Z"
6
+ }
7
+ ]
8
+ }
@@ -15,7 +15,7 @@ describe Zoom::Actions::Meeting do
15
15
  zoom_url("/users/#{args[:user_id]}/meetings")
16
16
  ).to_return(status: 201,
17
17
  body: json_response('meeting','create'),
18
- headers: {"Content-Type"=> "application/json"})
18
+ headers: { 'Content-Type' => 'application/json' })
19
19
  end
20
20
 
21
21
  it "requires user_id param" do
@@ -52,7 +52,7 @@ describe Zoom::Actions::Meeting do
52
52
  zoom_url("/users/#{args[:user_id]}/meetings")
53
53
  ).to_return(status: 404,
54
54
  body: json_response('error', 'user_not_exist'),
55
- headers: {"Content-Type"=> "application/json"})
55
+ headers: { 'Content-Type' => 'application/json' })
56
56
  end
57
57
 
58
58
  it 'raises an error' do
@@ -14,7 +14,7 @@ describe Zoom::Actions::Report do
14
14
  zoom_url("/report/webinars/#{args[:id]}/participants")
15
15
  ).to_return(status: 200,
16
16
  body: json_response('report', 'webinar', 'participants'),
17
- headers: {"Content-Type"=> "application/json"})
17
+ headers: { 'Content-Type' => 'application/json' })
18
18
  end
19
19
 
20
20
  it "requires a 'id' argument" do
@@ -33,7 +33,7 @@ describe Zoom::Actions::Report do
33
33
  zoom_url("/report/webinars/#{args[:id]}/participants")
34
34
  ).to_return(status: 404,
35
35
  body: json_response('error', 'not_found'),
36
- headers: {"Content-Type"=> "application/json"})
36
+ headers: { 'Content-Type' => 'application/json' })
37
37
  end
38
38
 
39
39
  it 'raises an error' do
@@ -21,7 +21,7 @@ describe Zoom::Actions::User do
21
21
  zoom_url('/users')
22
22
  ).to_return(status: 201,
23
23
  body: json_response('user', 'create'),
24
- headers: {"Content-Type"=> "application/json"})
24
+ headers: { 'Content-Type' => 'application/json' })
25
25
  end
26
26
 
27
27
  it 'requires action param' do
@@ -91,7 +91,7 @@ describe Zoom::Actions::User do
91
91
  zoom_url('/users')
92
92
  ).to_return(status: 409,
93
93
  body: json_response('error', 'already_exists'),
94
- headers: {"Content-Type"=> "application/json"})
94
+ headers: { 'Content-Type' => 'application/json' })
95
95
  end
96
96
 
97
97
  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: {"Content-Type"=> "application/json"})
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: {"Content-Type"=> "application/json"})
36
+ headers: { 'Content-Type' => 'application/json' })
37
37
  end
38
38
 
39
39
  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: 200,
16
16
  body: json_response('user', 'get'),
17
- headers: {"Content-Type"=> "application/json"})
17
+ headers: { 'Content-Type' => 'application/json' })
18
18
  end
19
19
 
20
20
  it 'requires id param' do
@@ -43,7 +43,7 @@ describe Zoom::Actions::User do
43
43
  zoom_url("/users/#{args[:id]}")
44
44
  ).to_return(status: 404,
45
45
  body: json_response('error', 'validation'),
46
- headers: {"Content-Type"=> "application/json"})
46
+ headers: { 'Content-Type' => 'application/json' })
47
47
  end
48
48
 
49
49
  it 'raises Zoom::Error exception' do
@@ -12,7 +12,7 @@ describe Zoom::Actions::User do
12
12
  :get,
13
13
  zoom_url('/users')
14
14
  ).to_return(body: json_response('user', 'list'),
15
- headers: {"Content-Type"=> "application/json"})
15
+ headers: { 'Content-Type' => 'application/json' })
16
16
  end
17
17
 
18
18
  it 'returns a hash' do
@@ -39,7 +39,7 @@ describe Zoom::Actions::User do
39
39
  zoom_url('/users')
40
40
  ).to_return(status: 404,
41
41
  body: json_response('error', 'not_found'),
42
- headers: {"Content-Type"=> "application/json"})
42
+ headers: { 'Content-Type' => 'application/json' })
43
43
  end
44
44
 
45
45
  it 'raises Zoom::Error exception' do
@@ -16,7 +16,7 @@ describe Zoom::Actions::User do
16
16
  zoom_url("/users/#{args[:id]}")
17
17
  ).to_return(status: 204,
18
18
  body: json_response('user', 'update'),
19
- headers: {"Content-Type"=> "application/json"})
19
+ headers: { 'Content-Type' => 'application/json' })
20
20
  end
21
21
 
22
22
  it 'requires id param' do
@@ -34,7 +34,7 @@ describe Zoom::Actions::User do
34
34
  zoom_url("/users/#{args[:id]}")
35
35
  ).to_return(status: 404,
36
36
  body: json_response('error', 'validation'),
37
- headers: {"Content-Type"=> "application/json"})
37
+ headers: { 'Content-Type' => 'application/json' })
38
38
  end
39
39
 
40
40
  it 'raises an error' do
@@ -13,7 +13,7 @@ RSpec.describe Zoom::Actions::Webinar do
13
13
  :post,
14
14
  zoom_url("/users/#{args[:host_id]}/webinars")
15
15
  ).to_return(body: json_response('webinar', 'create'),
16
- headers: {"Content-Type"=> "application/json"})
16
+ headers: { 'Content-Type' => 'application/json' })
17
17
  end
18
18
 
19
19
  it "requires a 'host_id' argument" do
@@ -43,7 +43,7 @@ RSpec.describe Zoom::Actions::Webinar do
43
43
  :post,
44
44
  zoom_url("/users/#{args[:host_id]}/webinars")
45
45
  ).to_return(body: json_response('error', 'validation'),
46
- headers: {"Content-Type"=> "application/json"})
46
+ headers: { 'Content-Type' => 'application/json' })
47
47
  end
48
48
 
49
49
  it 'raises Zoom::Error exception' do
@@ -3,7 +3,7 @@
3
3
  require 'spec_helper'
4
4
 
5
5
  describe Zoom::Actions::Webinar do
6
- let(:zc) { zoom_client}
6
+ let(:zc) { zoom_client }
7
7
  let(:args) { { id: '123456789' } }
8
8
 
9
9
  describe '#webinar_delete' do
@@ -14,7 +14,7 @@ describe Zoom::Actions::Webinar do
14
14
  zoom_url("/webinars/#{args[:id]}")
15
15
  ).to_return(status: 204,
16
16
  body: json_response('webinar', 'delete'),
17
- headers: {"Content-Type"=> "application/json"})
17
+ headers: { 'Content-Type' => 'application/json' })
18
18
  end
19
19
 
20
20
  it "requires a 'id' argument" do
@@ -33,7 +33,7 @@ describe Zoom::Actions::Webinar do
33
33
  zoom_url("/webinars/#{args[:id]}")
34
34
  ).to_return(status: 404,
35
35
  body: json_response('error', 'validation'),
36
- headers: {"Content-Type"=> "application/json"})
36
+ headers: { 'Content-Type' => 'application/json' })
37
37
  end
38
38
 
39
39
  it 'raises Zoom::Error exception' do
@@ -18,7 +18,7 @@ xdescribe Zoom::Actions::Webinar do
18
18
  :post,
19
19
  zoom_url('/webinar/get')
20
20
  ).to_return(body: json_response('webinar_get'),
21
- headers: {"Content-Type"=> "application/json"})
21
+ headers: { 'Content-Type' => 'application/json' })
22
22
  end
23
23
 
24
24
  it "requires a 'host_id' argument" do
@@ -13,7 +13,7 @@ RSpec.describe Zoom::Actions::Webinar do
13
13
  :get,
14
14
  zoom_url("/users/#{args[:host_id]}/webinars")
15
15
  ).to_return(body: json_response('webinar', 'list'),
16
- headers: {"Content-Type"=> "application/json"})
16
+ headers: { 'Content-Type' => 'application/json' })
17
17
  end
18
18
 
19
19
  it "requires a 'host_id' argument" do
@@ -39,7 +39,7 @@ RSpec.describe Zoom::Actions::Webinar do
39
39
  :get,
40
40
  zoom_url("/users/#{args[:host_id]}/webinars")
41
41
  ).to_return(body: json_response('error', 'validation'),
42
- headers: {"Content-Type"=> "application/json"})
42
+ headers: { 'Content-Type' => 'application/json' })
43
43
  end
44
44
 
45
45
  it 'raises Zoom::Error exception' do
@@ -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 '#past_webinar_list' do
10
+ context 'with a valid response' do
11
+ before :each do
12
+ stub_request(
13
+ :get,
14
+ zoom_url("/past_webinars/#{args[:id]}/instances")
15
+ ).to_return(status: 200,
16
+ body: json_response('webinar', 'past_webinar_list'),
17
+ headers: { 'Content-Type' => 'application/json' })
18
+ end
19
+
20
+ it "requires a 'id' argument" do
21
+ expect { zc.past_webinar_list(filter_key(args, :id)) }.to raise_error(Zoom::ParameterMissing, [:id].to_s)
22
+ end
23
+
24
+ it 'returns a list of webinar instances as an array' do
25
+ expect(zc.past_webinar_list(args)['webinars']).to be_kind_of(Array)
26
+ end
27
+ end
28
+
29
+ context 'with a 4xx response' do
30
+ before :each do
31
+ stub_request(
32
+ :get,
33
+ zoom_url("/past_webinars/#{args[:id]}/instances")
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.past_webinar_list(args) }.to raise_error(Zoom::Error)
41
+ end
42
+ end
43
+ end
44
+ end
@@ -17,7 +17,7 @@ RSpec.describe Zoom::Actions::Webinar do
17
17
  zoom_url("/webinars/#{args[:id]}/registrants")
18
18
  ).to_return(status: 201,
19
19
  body: json_response('webinar', 'registrant', 'add'),
20
- headers: {"Content-Type"=> "application/json"})
20
+ headers: { 'Content-Type' => 'application/json' })
21
21
  end
22
22
 
23
23
  it "requires a 'id' argument" do
@@ -53,7 +53,7 @@ RSpec.describe Zoom::Actions::Webinar do
53
53
  zoom_url("/webinars/#{args[:id]}/registrants")
54
54
  ).to_return(status: 404,
55
55
  body: json_response('error', 'not_found'),
56
- headers: {"Content-Type"=> "application/json"})
56
+ headers: { 'Content-Type' => 'application/json' })
57
57
  end
58
58
 
59
59
  it 'raises Zoom::Error exception' do
@@ -13,7 +13,7 @@ RSpec.describe Zoom::Actions::Webinar do
13
13
  :get,
14
14
  zoom_url("/webinars/#{args[:id]}/registrants")
15
15
  ).to_return(body: json_response('webinar', 'registrant', 'list'),
16
- headers: {"Content-Type"=> "application/json"})
16
+ headers: { 'Content-Type' => 'application/json' })
17
17
  end
18
18
 
19
19
  it "requires a 'id' argument" do
@@ -32,7 +32,7 @@ RSpec.describe Zoom::Actions::Webinar do
32
32
  zoom_url("/webinars/#{args[:id]}/registrants")
33
33
  ).to_return(status: 404,
34
34
  body: json_response('error', 'validation'),
35
- headers: {"Content-Type"=> "application/json"})
35
+ headers: { 'Content-Type' => 'application/json' })
36
36
  end
37
37
 
38
38
  it 'raises Zoom::Error exception' do
@@ -31,7 +31,7 @@ RSpec.describe Zoom::Actions::Webinar do
31
31
  zoom_url("/webinars/#{args[:id]}/registrants/status")
32
32
  ).to_return(status: 404,
33
33
  body: json_response('error', 'validation'),
34
- headers: {"Content-Type"=> "application/json"})
34
+ headers: { 'Content-Type' => 'application/json' })
35
35
  end
36
36
 
37
37
  it 'raises Zoom::Error exception' do
@@ -14,7 +14,7 @@ describe Zoom::Actions::Webinar do
14
14
  zoom_url("/webinars/#{args[:id]}")
15
15
  ).to_return(status: 204,
16
16
  body: json_response('webinar', 'update'),
17
- headers: {"Content-Type"=> "application/json"})
17
+ headers: { 'Content-Type' => 'application/json' })
18
18
  end
19
19
 
20
20
  it "requires a 'id' argument" do
@@ -33,7 +33,7 @@ describe Zoom::Actions::Webinar do
33
33
  zoom_url("/webinars/#{args[:id]}")
34
34
  ).to_return(status: 404,
35
35
  body: json_response('error', 'not_found'),
36
- headers: {"Content-Type"=> "application/json"})
36
+ headers: { 'Content-Type' => 'application/json' })
37
37
  end
38
38
 
39
39
  it 'raises an error' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zoom_rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Boe
@@ -145,7 +145,6 @@ extra_rdoc_files: []
145
145
  files:
146
146
  - ".circleci/config.yml"
147
147
  - ".gitignore"
148
- - ".ruby-version"
149
148
  - Gemfile
150
149
  - Gemfile.lock
151
150
  - LICENSE
@@ -211,6 +210,7 @@ files:
211
210
  - spec/fixtures/webinar/create.json
212
211
  - spec/fixtures/webinar/delete.json
213
212
  - spec/fixtures/webinar/list.json
213
+ - spec/fixtures/webinar/past_webinar_list.json
214
214
  - spec/fixtures/webinar/registrant/add.json
215
215
  - spec/fixtures/webinar/registrant/list.json
216
216
  - spec/fixtures/webinar/update.json
@@ -306,6 +306,7 @@ files:
306
306
  - spec/lib/zoom/actions/webinar/list_registration_spec.rb
307
307
  - spec/lib/zoom/actions/webinar/list_spec.rb
308
308
  - spec/lib/zoom/actions/webinar/panelists_spec.rb
309
+ - spec/lib/zoom/actions/webinar/past_webinar_list_spec.rb
309
310
  - spec/lib/zoom/actions/webinar/polls_spec.rb
310
311
  - spec/lib/zoom/actions/webinar/questions_spec.rb
311
312
  - spec/lib/zoom/actions/webinar/register_spec.rb
@@ -386,6 +387,7 @@ test_files:
386
387
  - spec/fixtures/webinar/create.json
387
388
  - spec/fixtures/webinar/delete.json
388
389
  - spec/fixtures/webinar/list.json
390
+ - spec/fixtures/webinar/past_webinar_list.json
389
391
  - spec/fixtures/webinar/registrant/add.json
390
392
  - spec/fixtures/webinar/registrant/list.json
391
393
  - spec/fixtures/webinar/update.json
@@ -481,6 +483,7 @@ test_files:
481
483
  - spec/lib/zoom/actions/webinar/list_registration_spec.rb
482
484
  - spec/lib/zoom/actions/webinar/list_spec.rb
483
485
  - spec/lib/zoom/actions/webinar/panelists_spec.rb
486
+ - spec/lib/zoom/actions/webinar/past_webinar_list_spec.rb
484
487
  - spec/lib/zoom/actions/webinar/polls_spec.rb
485
488
  - spec/lib/zoom/actions/webinar/questions_spec.rb
486
489
  - spec/lib/zoom/actions/webinar/register_spec.rb
@@ -1 +0,0 @@
1
- 2.6.2