zoomus 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/zoomus/actions/user.rb +13 -1
- data/spec/fixtures/user_get.json +8 -0
- data/spec/fixtures/user_getbyemail.json +8 -0
- data/spec/lib/zoomus/actions/user/get_spec.rb +48 -0
- data/spec/lib/zoomus/actions/user/getbyemail_spec.rb +53 -0
- data/zoomus.gemspec +1 -1
- metadata +10 -3
- data/CHANGELOG +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0a16f3eef56b54498dbf55b87818a53b9993888
|
4
|
+
data.tar.gz: 4987f1466145cf311491d059b96c5148d19913c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51ca34a453bf7cf287b68db4c9b39a5382e39543694278c074afe9d94422ebf7cc80d7b3cc80ffa4603ed320d831c3690fbe30b6b05d42038a8651021c528588
|
7
|
+
data.tar.gz: a455d9636adeec92d9a7a7284f472ff851808e88da0dcbdd977f4827946e27b8a1421f751060c9588cd48d2a96a489b7bb9134a2bc16a5973ee18a6d3b656936
|
data/README.md
CHANGED
data/lib/zoomus/actions/user.rb
CHANGED
@@ -31,8 +31,20 @@ module Zoomus
|
|
31
31
|
Utils.parse_response self.class.post('/user/update', :query => options)
|
32
32
|
end
|
33
33
|
|
34
|
-
|
34
|
+
def user_get(*args)
|
35
|
+
options = Utils.extract_options!(args)
|
36
|
+
Utils.require_params([:id], options)
|
37
|
+
Utils.parse_response self.class.post('/user/get', :query => options)
|
38
|
+
end
|
35
39
|
|
40
|
+
def user_getbyemail(*args)
|
41
|
+
options = Utils.extract_options!(args)
|
42
|
+
Utils.require_params([:email, :login_type], options)
|
43
|
+
Utils.parse_response self.class.post('/user/getbyemail', :query => options)
|
44
|
+
end
|
45
|
+
|
46
|
+
Utils.define_bang_methods(self)
|
47
|
+
|
36
48
|
end
|
37
49
|
end
|
38
50
|
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Zoomus::Actions::User do
|
4
|
+
|
5
|
+
before :all do
|
6
|
+
@zc = zoomus_client
|
7
|
+
@args = {:id => "ufR9342pRyf8ePFN92dttQ"}
|
8
|
+
end
|
9
|
+
|
10
|
+
describe "#user_get action" do
|
11
|
+
before :each do
|
12
|
+
stub_request(:post, zoomus_url("/user/get")).to_return(:body => json_response("user_get"))
|
13
|
+
end
|
14
|
+
|
15
|
+
it "requires id param" do
|
16
|
+
expect{@zc.user_get(filter_key(@args, :id))}.to raise_error(ArgumentError)
|
17
|
+
end
|
18
|
+
|
19
|
+
it "returns a hash" do
|
20
|
+
expect(@zc.user_get(@args)).to be_kind_of(Hash)
|
21
|
+
end
|
22
|
+
|
23
|
+
it "returns same params" do
|
24
|
+
res = @zc.user_get(@args)
|
25
|
+
|
26
|
+
expect(res["id"]).to eq(@args[:id])
|
27
|
+
expect(res).to have_key("first_name")
|
28
|
+
expect(res).to have_key("last_name")
|
29
|
+
expect(res).to have_key("email")
|
30
|
+
expect(res).to have_key("type")
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
describe "#user_get! action" do
|
35
|
+
before :each do
|
36
|
+
stub_request(
|
37
|
+
:post,
|
38
|
+
zoomus_url("/user/get")
|
39
|
+
).to_return(:body => json_response("error"))
|
40
|
+
end
|
41
|
+
|
42
|
+
it "raises Zoomus::Error exception" do
|
43
|
+
expect {
|
44
|
+
@zc.user_get!(@args)
|
45
|
+
}.to raise_error(Zoomus::Error)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Zoomus::Actions::User do
|
4
|
+
|
5
|
+
before :all do
|
6
|
+
@zc = zoomus_client
|
7
|
+
@args = {:email => "foo@bar.com",
|
8
|
+
:login_type => 99}
|
9
|
+
end
|
10
|
+
|
11
|
+
describe "#user_getbyemail action" do
|
12
|
+
before :each do
|
13
|
+
stub_request(:post, zoomus_url("/user/getbyemail")).to_return(:body => json_response("user_getbyemail"))
|
14
|
+
end
|
15
|
+
|
16
|
+
it "requires email param" do
|
17
|
+
expect{@zc.user_getbyemail(filter_key(@args, :email))}.to raise_error(ArgumentError)
|
18
|
+
end
|
19
|
+
|
20
|
+
it "requires login_type param" do
|
21
|
+
expect{@zc.user_getbyemail(filter_key(@args, :login_type))}.to raise_error(ArgumentError)
|
22
|
+
end
|
23
|
+
|
24
|
+
it "returns a hash" do
|
25
|
+
expect(@zc.user_getbyemail(@args)).to be_kind_of(Hash)
|
26
|
+
end
|
27
|
+
|
28
|
+
it "returns same params" do
|
29
|
+
res = @zc.user_getbyemail(@args)
|
30
|
+
|
31
|
+
expect(res).to have_key("id")
|
32
|
+
expect(res).to have_key("first_name")
|
33
|
+
expect(res).to have_key("last_name")
|
34
|
+
expect(res["email"]).to eq(@args[:email])
|
35
|
+
expect(res["type"]).to eq(@args[:login_type])
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
describe "#user_getbyemail! action" do
|
40
|
+
before :each do
|
41
|
+
stub_request(
|
42
|
+
:post,
|
43
|
+
zoomus_url("/user/getbyemail")
|
44
|
+
).to_return(:body => json_response("error"))
|
45
|
+
end
|
46
|
+
|
47
|
+
it "raises Zoomus::Error exception" do
|
48
|
+
expect {
|
49
|
+
@zc.user_getbyemail!(@args)
|
50
|
+
}.to raise_error(Zoomus::Error)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
data/zoomus.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zoomus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maxim Colls
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-04-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -46,7 +46,6 @@ extensions: []
|
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
48
|
- ".gitignore"
|
49
|
-
- CHANGELOG
|
50
49
|
- Gemfile
|
51
50
|
- LICENSE
|
52
51
|
- Makefile
|
@@ -69,6 +68,8 @@ files:
|
|
69
68
|
- spec/fixtures/user_create.json
|
70
69
|
- spec/fixtures/user_custcreate.json
|
71
70
|
- spec/fixtures/user_delete.json
|
71
|
+
- spec/fixtures/user_get.json
|
72
|
+
- spec/fixtures/user_getbyemail.json
|
72
73
|
- spec/fixtures/user_list.json
|
73
74
|
- spec/fixtures/user_update.json
|
74
75
|
- spec/lib/zoomus/actions/meeting/create_spec.rb
|
@@ -80,6 +81,8 @@ files:
|
|
80
81
|
- spec/lib/zoomus/actions/user/create_spec.rb
|
81
82
|
- spec/lib/zoomus/actions/user/custcreate_spec.rb
|
82
83
|
- spec/lib/zoomus/actions/user/delete_spec.rb
|
84
|
+
- spec/lib/zoomus/actions/user/get_spec.rb
|
85
|
+
- spec/lib/zoomus/actions/user/getbyemail_spec.rb
|
83
86
|
- spec/lib/zoomus/actions/user/list_spec.rb
|
84
87
|
- spec/lib/zoomus/actions/user/update_spec.rb
|
85
88
|
- spec/lib/zoomus/client_spec.rb
|
@@ -121,6 +124,8 @@ test_files:
|
|
121
124
|
- spec/fixtures/user_create.json
|
122
125
|
- spec/fixtures/user_custcreate.json
|
123
126
|
- spec/fixtures/user_delete.json
|
127
|
+
- spec/fixtures/user_get.json
|
128
|
+
- spec/fixtures/user_getbyemail.json
|
124
129
|
- spec/fixtures/user_list.json
|
125
130
|
- spec/fixtures/user_update.json
|
126
131
|
- spec/lib/zoomus/actions/meeting/create_spec.rb
|
@@ -132,6 +137,8 @@ test_files:
|
|
132
137
|
- spec/lib/zoomus/actions/user/create_spec.rb
|
133
138
|
- spec/lib/zoomus/actions/user/custcreate_spec.rb
|
134
139
|
- spec/lib/zoomus/actions/user/delete_spec.rb
|
140
|
+
- spec/lib/zoomus/actions/user/get_spec.rb
|
141
|
+
- spec/lib/zoomus/actions/user/getbyemail_spec.rb
|
135
142
|
- spec/lib/zoomus/actions/user/list_spec.rb
|
136
143
|
- spec/lib/zoomus/actions/user/update_spec.rb
|
137
144
|
- spec/lib/zoomus/client_spec.rb
|
data/CHANGELOG
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
Version 0.1.0 (March 2013)
|
2
|
-
- Added /user and /meeting endpoints.
|
3
|
-
|
4
|
-
Version 0.2.0 (May 2013)
|
5
|
-
- Added /report endpoint (getuserreport and getaccountreport actions).
|
6
|
-
- Added support for Time objects as datetime parameters (from, to).
|
7
|
-
- Added configuration block Zoomus.configure.
|
8
|
-
- Deprecated Zoomus.new(:api_key => 'xxx', :api_secret => 'xxx') shortcut.
|