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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b0d20056587e89b7cbcf84479124a9b0f4acbff8
4
- data.tar.gz: 2233ae2a035138e4a3c277c9401d7cd67518a9a7
3
+ metadata.gz: 10ef64687454c33ffd784d584b208b103ebf76d0
4
+ data.tar.gz: a1ad722df0ce2d4c8aecc81f6a9b27bfc65f999a
5
5
  SHA512:
6
- metadata.gz: 788dcf706f3224e44d54982106025d53c36bb098dd6342ce69c090232dc31ee21e7e6161b3bd116cbcc3d52a106fbf22afd120649324196dc24f59e0271c3694
7
- data.tar.gz: f1855b5714c88c240440728f3bd562439b7fe69d3f71e9d8ad9612536531eeabc7d1341f876f7aa05acdea4c74b4e5337bbdec3cef25d86bc312cf893d7ef94b
6
+ metadata.gz: 265ec78b0174c91c2fe36432356ba9a7b86e12e3e10dbf0edf20a377d0af8722bbb59472f307bba786e549550d18894e1dfe9fbf1423b96d5f9ec5f7731edfb6
7
+ data.tar.gz: 3f9ce98ea65710392b766d2866cfe8d5a838490d368898a7fbc413e2412e4125d31c19c602c2f086b6520905fb421cf0f45d3a8345a77ae87b5d66fd5a18ac96
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Bearcat
2
- VERSION = '1.3.20' unless defined?(Bearcat::VERSION)
2
+ VERSION = '1.3.21' unless defined?(Bearcat::VERSION)
3
3
  end
@@ -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"}
@@ -0,0 +1,6 @@
1
+ {
2
+ "dashboard_positions": {
3
+ "course_42": 2,
4
+ "course_88": 1
5
+ }
6
+ }
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.20
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: 2017-12-14 00:00:00.000000000 Z
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.8
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: