bearcat 1.3.20 → 1.3.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bearcat/client/users.rb +17 -0
- data/lib/bearcat/version.rb +1 -1
- data/spec/bearcat/client/users_spec.rb +6 -0
- data/spec/fixtures/dashboard.json +6 -0
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10ef64687454c33ffd784d584b208b103ebf76d0
|
4
|
+
data.tar.gz: a1ad722df0ce2d4c8aecc81f6a9b27bfc65f999a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 265ec78b0174c91c2fe36432356ba9a7b86e12e3e10dbf0edf20a377d0af8722bbb59472f307bba786e549550d18894e1dfe9fbf1423b96d5f9ec5f7731edfb6
|
7
|
+
data.tar.gz: 3f9ce98ea65710392b766d2866cfe8d5a838490d368898a7fbc413e2412e4125d31c19c602c2f086b6520905fb421cf0f45d3a8345a77ae87b5d66fd5a18ac96
|
data/lib/bearcat/client/users.rb
CHANGED
@@ -64,6 +64,23 @@ module Bearcat
|
|
64
64
|
get("/api/v1/users/#{user}/courses/#{course}/assignments", params)
|
65
65
|
end
|
66
66
|
|
67
|
+
def dashboard_positions(user, params = {})
|
68
|
+
get("/api/v1/users/#{user}/dashboard_positions", params)
|
69
|
+
end
|
70
|
+
|
71
|
+
def update_dashboard_positions(user, params = {})
|
72
|
+
put("/api/v1/users/#{user}/dashboard_positions", params)
|
73
|
+
end
|
74
|
+
|
75
|
+
def favorite_courses(user, params = {})
|
76
|
+
params.merge!({as_user_id: user})
|
77
|
+
get("/api/v1/users/self/favorites/courses", params)
|
78
|
+
end
|
79
|
+
|
80
|
+
def unfavorite_course(user, course, params = {})
|
81
|
+
params.merge!({as_user_id: user})
|
82
|
+
delete("/api/v1/users/self/favorites/courses/#{course}", params)
|
83
|
+
end
|
67
84
|
end
|
68
85
|
end
|
69
86
|
end
|
data/lib/bearcat/version.rb
CHANGED
@@ -78,6 +78,12 @@ describe Bearcat::Client::Users do
|
|
78
78
|
assignments.first["due_at"].should == nil
|
79
79
|
end
|
80
80
|
|
81
|
+
it 'retuns a users dashboard' do
|
82
|
+
stub_get(@client, "/api/v1/users/1/dashboard_positions").to_return(json_response("dashboard.json"))
|
83
|
+
dashboard = @client.dashboard_positions(1)
|
84
|
+
dashboard["dashboard_positions"].length.should == 2
|
85
|
+
end
|
86
|
+
|
81
87
|
describe 'user custom data' do
|
82
88
|
before (:each) do
|
83
89
|
@query = {"ns" => "com.test.app"}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bearcat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Mills, Jake Sorce
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -236,6 +236,7 @@ files:
|
|
236
236
|
- spec/fixtures/custom_gradebook_columns/column_data.json
|
237
237
|
- spec/fixtures/custom_gradebook_columns/custom_gradebook_column.json
|
238
238
|
- spec/fixtures/custom_gradebook_columns/custom_gradebook_columns.json
|
239
|
+
- spec/fixtures/dashboard.json
|
239
240
|
- spec/fixtures/delete_course.json
|
240
241
|
- spec/fixtures/delete_custom_data_scope.json
|
241
242
|
- spec/fixtures/delete_group_category.json
|
@@ -319,7 +320,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
319
320
|
version: '0'
|
320
321
|
requirements: []
|
321
322
|
rubyforge_project:
|
322
|
-
rubygems_version: 2.4.
|
323
|
+
rubygems_version: 2.4.5.1
|
323
324
|
signing_key:
|
324
325
|
specification_version: 4
|
325
326
|
summary: Canvas API
|
@@ -420,6 +421,7 @@ test_files:
|
|
420
421
|
- spec/fixtures/custom_gradebook_columns/column_data.json
|
421
422
|
- spec/fixtures/custom_gradebook_columns/custom_gradebook_column.json
|
422
423
|
- spec/fixtures/custom_gradebook_columns/custom_gradebook_columns.json
|
424
|
+
- spec/fixtures/dashboard.json
|
423
425
|
- spec/fixtures/delete_course.json
|
424
426
|
- spec/fixtures/delete_custom_data_scope.json
|
425
427
|
- spec/fixtures/delete_group_category.json
|
@@ -484,3 +486,4 @@ test_files:
|
|
484
486
|
- spec/fixtures/user_page_views.json
|
485
487
|
- spec/fixtures/user_profile.json
|
486
488
|
- spec/helper.rb
|
489
|
+
has_rdoc:
|