bearcat 0.9.6 → 0.9.7
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 +8 -8
- data/lib/bearcat/client/users.rb +4 -0
- data/lib/bearcat/version.rb +1 -1
- data/spec/bearcat/client/users_spec.rb +7 -0
- data/spec/fixtures/user_profile.json +15 -0
- metadata +3 -1
checksums.yaml
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
!binary "U0hBMQ==":
|
|
3
3
|
metadata.gz: !binary |-
|
|
4
|
-
|
|
4
|
+
Njk3NWEyZjNjOWU0MjdkZmMwYjBkNWIxNzkwNDg2MDFmNjk5MDgxZg==
|
|
5
5
|
data.tar.gz: !binary |-
|
|
6
|
-
|
|
6
|
+
NDBiN2YwNDc3Njc0NDBiODhlNjcyZTk4YTQ1NzEzYWQyNjgxZTY1OQ==
|
|
7
7
|
SHA512:
|
|
8
8
|
metadata.gz: !binary |-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
ODExY2NlNGU0Yjk2MmE5Y2FiZTVmYWMyMzdkYjA4NzIxNTYxZTgxMTg1Zjhj
|
|
10
|
+
MGUxNDgxNTgxYmE3NjQwOWFkMzQ3OTU0MDRlNDQwMDQyZDM4NGQyMjg4MGRh
|
|
11
|
+
YmVkZDU3MmNmNzc1N2YyZjk1NTU3OTAwMDljYjk4OWYwMDAyM2M=
|
|
12
12
|
data.tar.gz: !binary |-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
MmZkNDdhZGU3MzMxNzZmYmFlNWY5MGYxZTBkMGE5YjlkZTk5Nzg4ZmQwNTk1
|
|
14
|
+
YzM4YTE0ZmZlMzgwNzEzNzg0MjMzNGZhMWQ4YWY5ODExYjA4YWViNTAxYTFi
|
|
15
|
+
OGZhMjA1MTA1NjA3OWI1YTJmMjRhMTU0OWJiYTEyMjRhOGIwMDk=
|
data/lib/bearcat/client/users.rb
CHANGED
|
@@ -14,6 +14,10 @@ module Bearcat
|
|
|
14
14
|
post("/api/v1/accounts/#{account.to_s}/users", params)
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
+
def user_profile(user)
|
|
18
|
+
get("/api/v1/users/#{user.to_s}/profile")
|
|
19
|
+
end
|
|
20
|
+
|
|
17
21
|
# scope: food
|
|
18
22
|
# params: {ns: 'com.account-domain.canvas-app'}
|
|
19
23
|
# returns all custom user food scope data. If no scope returns all custom user data
|
data/lib/bearcat/version.rb
CHANGED
|
@@ -31,6 +31,13 @@ describe Bearcat::Client::Users do
|
|
|
31
31
|
user_avatars.first['type'].should == 'gravatar'
|
|
32
32
|
end
|
|
33
33
|
|
|
34
|
+
it "returns a users profile" do
|
|
35
|
+
stub_get(@client, "/api/v1/users/1/profile").to_return(json_response("user_profile.json"))
|
|
36
|
+
user_profile = @client.user_profile(1)
|
|
37
|
+
user_profile["id"].should == 1
|
|
38
|
+
user_profile["time_zone"].should == "America/Denver"
|
|
39
|
+
end
|
|
40
|
+
|
|
34
41
|
describe 'user custom data' do
|
|
35
42
|
before (:each) do
|
|
36
43
|
@query = {"ns" => "com.test.app"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": 1,
|
|
3
|
+
"name": "test user",
|
|
4
|
+
"short_name": "test user",
|
|
5
|
+
"sortable_name": "user, test",
|
|
6
|
+
"login_id": "testuser@example.com",
|
|
7
|
+
"avatar_url": "http://localhost:3000/images/thumbnails/1/mBD6J4naPCw2eAwfVEgZM1HzUSELnkednRPdw7MM",
|
|
8
|
+
"title": null,
|
|
9
|
+
"bio": null,
|
|
10
|
+
"primary_email": "testuser@example.com",
|
|
11
|
+
"time_zone": "America/Denver",
|
|
12
|
+
"calendar": {
|
|
13
|
+
"ics": "http://localhost:3000/feeds/calendars/user_KprS56U315nwS9tky4ojbodAk7BoCAb6DdlVC4lh.ics"
|
|
14
|
+
}
|
|
15
|
+
}
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bearcat
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.9.
|
|
4
|
+
version: 0.9.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nathan Mills, Jake Sorce
|
|
@@ -180,6 +180,7 @@ files:
|
|
|
180
180
|
- spec/fixtures/update_section.json
|
|
181
181
|
- spec/fixtures/user_avatars.json
|
|
182
182
|
- spec/fixtures/user_enrollments.json
|
|
183
|
+
- spec/fixtures/user_profile.json
|
|
183
184
|
- spec/helper.rb
|
|
184
185
|
homepage:
|
|
185
186
|
licenses: []
|
|
@@ -264,5 +265,6 @@ test_files:
|
|
|
264
265
|
- spec/fixtures/update_section.json
|
|
265
266
|
- spec/fixtures/user_avatars.json
|
|
266
267
|
- spec/fixtures/user_enrollments.json
|
|
268
|
+
- spec/fixtures/user_profile.json
|
|
267
269
|
- spec/helper.rb
|
|
268
270
|
has_rdoc:
|