bearcat 1.0.20 → 1.0.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: a87865b2b4bf47b0f64274aa26e20899908c5bc0
4
- data.tar.gz: bd7c302183a87916fb2467a99c703d05f90769a2
3
+ metadata.gz: 07ee26b5b5644db55d1411270eee4fa65c72b7ec
4
+ data.tar.gz: 252d35246ec76da5b18d686d4b8b6e446d8be779
5
5
  SHA512:
6
- metadata.gz: d0c2aceebb37be6f9c9d5bb38688605972d76945471780c5c8b04198743584bf2b995fd7628e290c3ab86fe26208ecb31367f9e16264e6955c8d530776447b13
7
- data.tar.gz: 9f856792ce1c1d4c65a7c8c042e93cd3386c342330efd37452a12052d4f23481b2b40ff7c4a5b27e3faf2dbee92b99aa683a2102296953580e90ad48eab090e8
6
+ metadata.gz: c981f0dc5d187addef5f2f00a9019536808eba977c4dc1225a674d073529ebd7922ed815c7b2eed4706d59b097631a5d87950c54c3cc0059fb8461fc350706f8
7
+ data.tar.gz: ac6a668f73aab8ee4188d40b5eebe21fd9b920f0c38df4f4862caccc85c8104afdb7a161e9c08d175526052ea553fb4280d6c6ac4a84c58180ad6791551739b4
@@ -11,6 +11,7 @@ module Bearcat
11
11
  require 'bearcat/client/sections'
12
12
  require 'bearcat/client/o_auth2'
13
13
  require 'bearcat/client/groups'
14
+ require 'bearcat/client/group_categories'
14
15
  require 'bearcat/client/group_memberships'
15
16
  require 'bearcat/client/conferences'
16
17
  require 'bearcat/client/users'
@@ -37,6 +38,7 @@ module Bearcat
37
38
  include Sections
38
39
  include OAuth2
39
40
  include Groups
41
+ include GroupCategories
40
42
  include GroupMemberships
41
43
  include Conferences
42
44
  include Users
@@ -0,0 +1,11 @@
1
+ module Bearcat
2
+ class Client < Footrest::Client
3
+ module GroupCategories
4
+
5
+ def list_group_categories(context, id)
6
+ get("/api/v1/#{context}/#{id}/group_categories")
7
+ end
8
+
9
+ end
10
+ end
11
+ end
@@ -22,7 +22,7 @@ module Bearcat
22
22
  get("/api/v1/users/#{user.to_s}/logins", params)
23
23
  end
24
24
 
25
- def communication_channels(user, params)
25
+ def communication_channels(user, params={})
26
26
  get("/api/v1/users/#{user.to_s}/communication_channels", params)
27
27
  end
28
28
 
@@ -1,3 +1,3 @@
1
1
  module Bearcat
2
- VERSION = '1.0.20' unless defined?(Bearcat::VERSION)
2
+ VERSION = '1.0.21' unless defined?(Bearcat::VERSION)
3
3
  end
@@ -0,0 +1,16 @@
1
+ require 'helper'
2
+
3
+ describe Bearcat::Client::GroupCategories do
4
+ before do
5
+ @client = Bearcat::Client.new(prefix: "http://canvas.instructure.com", token: "test_token")
6
+ end
7
+
8
+ it "returns group categories" do
9
+ stub_get(@client, "/api/v1/courses/1809/group_categories").to_return(json_response("group_categories.json"))
10
+ categories = @client.list_group_categories('courses', 1809)
11
+ categories.count.should == 2
12
+ categories.first['name'].should == 'mark red'
13
+ categories.last['name'].should == 'test group'
14
+ end
15
+
16
+ end
@@ -0,0 +1,28 @@
1
+ [
2
+ {
3
+ "auto_leader": "first",
4
+ "group_limit": null,
5
+ "id": 5,
6
+ "name": "mark red",
7
+ "role": null,
8
+ "self_signup": null,
9
+ "context_type": "Course",
10
+ "course_id": 1809,
11
+ "protected": false,
12
+ "allows_multiple_memberships": false,
13
+ "is_member": false
14
+ },
15
+ {
16
+ "auto_leader": null,
17
+ "group_limit": null,
18
+ "id": 4,
19
+ "name": "test group",
20
+ "role": null,
21
+ "self_signup": null,
22
+ "context_type": "Course",
23
+ "course_id": 1809,
24
+ "protected": false,
25
+ "allows_multiple_memberships": false,
26
+ "is_member": false
27
+ }
28
+ ]
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.0.20
4
+ version: 1.0.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: 2015-07-13 00:00:00.000000000 Z
11
+ date: 2015-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -119,6 +119,7 @@ files:
119
119
  - lib/bearcat/client/enrollments.rb
120
120
  - lib/bearcat/client/file_helper.rb
121
121
  - lib/bearcat/client/files.rb
122
+ - lib/bearcat/client/group_categories.rb
122
123
  - lib/bearcat/client/group_memberships.rb
123
124
  - lib/bearcat/client/groups.rb
124
125
  - lib/bearcat/client/modules.rb
@@ -144,6 +145,7 @@ files:
144
145
  - spec/bearcat/client/discussions_spec.rb
145
146
  - spec/bearcat/client/enrollments_spec.rb
146
147
  - spec/bearcat/client/files_spec.rb
148
+ - spec/bearcat/client/group_categories_spec.rb
147
149
  - spec/bearcat/client/groups_spec.rb
148
150
  - spec/bearcat/client/modules_spec.rb
149
151
  - spec/bearcat/client/o_auth2_spec.rb
@@ -203,6 +205,7 @@ files:
203
205
  - spec/fixtures/deleted_conversation.json
204
206
  - spec/fixtures/enroll_student.json
205
207
  - spec/fixtures/enrollment_terms.json
208
+ - spec/fixtures/group_categories.json
206
209
  - spec/fixtures/group_conferences.json
207
210
  - spec/fixtures/link_unlink_outcome.json
208
211
  - spec/fixtures/module_item_sequence.json
@@ -273,6 +276,7 @@ test_files:
273
276
  - spec/bearcat/client/discussions_spec.rb
274
277
  - spec/bearcat/client/enrollments_spec.rb
275
278
  - spec/bearcat/client/files_spec.rb
279
+ - spec/bearcat/client/group_categories_spec.rb
276
280
  - spec/bearcat/client/groups_spec.rb
277
281
  - spec/bearcat/client/modules_spec.rb
278
282
  - spec/bearcat/client/o_auth2_spec.rb
@@ -332,6 +336,7 @@ test_files:
332
336
  - spec/fixtures/deleted_conversation.json
333
337
  - spec/fixtures/enroll_student.json
334
338
  - spec/fixtures/enrollment_terms.json
339
+ - spec/fixtures/group_categories.json
335
340
  - spec/fixtures/group_conferences.json
336
341
  - spec/fixtures/link_unlink_outcome.json
337
342
  - spec/fixtures/module_item_sequence.json
@@ -367,4 +372,3 @@ test_files:
367
372
  - spec/fixtures/user_page_views.json
368
373
  - spec/fixtures/user_profile.json
369
374
  - spec/helper.rb
370
- has_rdoc: