bearcat 1.2.10 → 1.2.11
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/group_memberships.rb +3 -0
- data/lib/bearcat/client/groups.rb +4 -0
- data/lib/bearcat/version.rb +1 -1
- data/spec/bearcat/client/groups_spec.rb +9 -0
- data/spec/bearcat/group_memberships_spec.rb +19 -0
- data/spec/fixtures/edited_group.json +129 -0
- data/spec/fixtures/ok.json +3 -0
- metadata +8 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fedf9fe9f4bcd702e30e35eba3d8e48554d92c2
|
4
|
+
data.tar.gz: 100c379061c19a64f3d5c99439f2aa2e4a797bf8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74e3cde675504f52e9d61d1976740ec221fcdfaf64c2e1527b06a009be97ffd0193a303179aeaf71f0f93723c0a5ea2c90b3712584428702240a86089410e89e
|
7
|
+
data.tar.gz: 97b034309fb261c0babfde01a180e9bf8f06f8b5ead1c9ae1ee9d66a71ed1be94c372f132bdb7531a6641c4761c132101767d4b0eb2239a9961de3a18e5ec984
|
@@ -17,6 +17,10 @@ module Bearcat
|
|
17
17
|
def create_group(group_category_id, params={})
|
18
18
|
post("/api/v1/group_categories/#{group_category_id}/groups", params)
|
19
19
|
end
|
20
|
+
|
21
|
+
def edit_group(group_id, params={})
|
22
|
+
put("/api/v1/groups/#{group_id}", params)
|
23
|
+
end
|
20
24
|
end
|
21
25
|
end
|
22
26
|
end
|
data/lib/bearcat/version.rb
CHANGED
@@ -36,4 +36,13 @@ describe Bearcat::Client::Groups do
|
|
36
36
|
created_group['context_type'] == 'Course'
|
37
37
|
created_group['group_category']['id'] == 2
|
38
38
|
end
|
39
|
+
|
40
|
+
it "edits a group" do
|
41
|
+
name = 'edited group 1'
|
42
|
+
description = 'edited group 1 description'
|
43
|
+
stub_put(@client, "/api/v1/groups/1").with(body: { name: name, description: description }).to_return(json_response("edited_group.json"))
|
44
|
+
edited_group = @client.edit_group(1, { name: name, description: description })
|
45
|
+
edited_group['name'] == name
|
46
|
+
edited_group['description'] == description
|
47
|
+
end
|
39
48
|
end
|
@@ -13,5 +13,24 @@ describe Bearcat::Client::GroupMemberships do
|
|
13
13
|
created_group_membership['workflow_state'] == 'accepted'
|
14
14
|
created_group_membership['user_id'] == 6
|
15
15
|
end
|
16
|
+
|
17
|
+
describe 'GroupMemberships#delete_group_membership' do
|
18
|
+
|
19
|
+
context 'deleting the group membership by id' do
|
20
|
+
it 'deletes a group membership' do
|
21
|
+
stub_delete(@client, "/api/v1/groups/3/memberships/3").to_return(json_response("ok.json"))
|
22
|
+
deleted_response = @client.delete_group_membership(3, 'memberships', 3)
|
23
|
+
deleted_response['ok'] == true
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
context 'deleting the group membership by user and group id' do
|
28
|
+
it 'deletes a group membership' do
|
29
|
+
stub_delete(@client, "/api/v1/groups/3/users/3").to_return(json_response("ok.json"))
|
30
|
+
deleted_response = @client.delete_group_membership(3, 'users', 3)
|
31
|
+
deleted_response['ok'] == true
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
16
35
|
end
|
17
36
|
|
@@ -0,0 +1,129 @@
|
|
1
|
+
{
|
2
|
+
"id": 1,
|
3
|
+
"name": "edited group 1",
|
4
|
+
"max_membership": null,
|
5
|
+
"is_public": false,
|
6
|
+
"join_level": "invitation_only",
|
7
|
+
"group_category_id": 8,
|
8
|
+
"description": "edited group 1 description",
|
9
|
+
"members_count": 9,
|
10
|
+
"storage_quota_mb": 50,
|
11
|
+
"permissions": {
|
12
|
+
"create_discussion_topic": true,
|
13
|
+
"join": false,
|
14
|
+
"create_announcement": true
|
15
|
+
},
|
16
|
+
"context_type": "Course",
|
17
|
+
"course_id": 14,
|
18
|
+
"avatar_url": null,
|
19
|
+
"role": null,
|
20
|
+
"leader": null,
|
21
|
+
"users": [
|
22
|
+
{
|
23
|
+
"id": 6,
|
24
|
+
"name": "admin3@instructure.com",
|
25
|
+
"sortable_name": "admin3@instructure.com",
|
26
|
+
"short_name": "admin3@instructure.com",
|
27
|
+
"sis_user_id": "7 - sis - 6",
|
28
|
+
"integration_id": null,
|
29
|
+
"sis_login_id": "admin3",
|
30
|
+
"sis_import_id": null,
|
31
|
+
"login_id": "admin3"
|
32
|
+
},
|
33
|
+
{
|
34
|
+
"id": 7,
|
35
|
+
"name": "admin4@instructure.com",
|
36
|
+
"sortable_name": "admin4@instructure.com",
|
37
|
+
"short_name": "admin4@instructure.com",
|
38
|
+
"sis_user_id": "8 - sis - 7",
|
39
|
+
"integration_id": null,
|
40
|
+
"sis_login_id": "admin4",
|
41
|
+
"sis_import_id": null,
|
42
|
+
"login_id": "admin4"
|
43
|
+
},
|
44
|
+
{
|
45
|
+
"id": 12,
|
46
|
+
"name": "student3",
|
47
|
+
"sortable_name": "student3",
|
48
|
+
"short_name": "student3",
|
49
|
+
"sis_user_id": "18 - sis - 12",
|
50
|
+
"integration_id": null,
|
51
|
+
"sis_login_id": "student3",
|
52
|
+
"sis_import_id": null,
|
53
|
+
"login_id": "student3"
|
54
|
+
},
|
55
|
+
{
|
56
|
+
"id": 14,
|
57
|
+
"name": "student4",
|
58
|
+
"sortable_name": "student4",
|
59
|
+
"short_name": "student4",
|
60
|
+
"sis_user_id": "26 - sis - 14",
|
61
|
+
"integration_id": null,
|
62
|
+
"sis_login_id": "student4",
|
63
|
+
"sis_import_id": null,
|
64
|
+
"login_id": "student4"
|
65
|
+
},
|
66
|
+
{
|
67
|
+
"id": 15,
|
68
|
+
"name": "student5",
|
69
|
+
"sortable_name": "student5",
|
70
|
+
"short_name": "student5",
|
71
|
+
"sis_user_id": "27 - sis - 15",
|
72
|
+
"integration_id": null,
|
73
|
+
"sis_login_id": "student5",
|
74
|
+
"sis_import_id": null,
|
75
|
+
"login_id": "student5"
|
76
|
+
},
|
77
|
+
{
|
78
|
+
"id": 16,
|
79
|
+
"name": "student6",
|
80
|
+
"sortable_name": "student6",
|
81
|
+
"short_name": "student6",
|
82
|
+
"sis_user_id": "28 - sis - 16",
|
83
|
+
"integration_id": null,
|
84
|
+
"sis_login_id": "student6",
|
85
|
+
"sis_import_id": null,
|
86
|
+
"login_id": "student6"
|
87
|
+
},
|
88
|
+
{
|
89
|
+
"id": 17,
|
90
|
+
"name": "student7",
|
91
|
+
"sortable_name": "student7",
|
92
|
+
"short_name": "student7",
|
93
|
+
"sis_user_id": "29 - sis - 17",
|
94
|
+
"integration_id": null,
|
95
|
+
"sis_login_id": "student7",
|
96
|
+
"sis_import_id": null,
|
97
|
+
"login_id": "student7"
|
98
|
+
},
|
99
|
+
{
|
100
|
+
"id": 41,
|
101
|
+
"name": "test_with_ivan",
|
102
|
+
"sortable_name": "test_with_ivan",
|
103
|
+
"short_name": "test_with_ivan",
|
104
|
+
"login_id": "test_with_ivan"
|
105
|
+
},
|
106
|
+
{
|
107
|
+
"id": 42,
|
108
|
+
"name": "test_with_ivan2",
|
109
|
+
"sortable_name": "test_with_ivan2",
|
110
|
+
"short_name": "test_with_ivan2",
|
111
|
+
"login_id": "test_with_ivan2"
|
112
|
+
}
|
113
|
+
],
|
114
|
+
"group_category": {
|
115
|
+
"id": 8,
|
116
|
+
"name": "Sections Cloned as Groups",
|
117
|
+
"role": null,
|
118
|
+
"self_signup": null,
|
119
|
+
"group_limit": null,
|
120
|
+
"auto_leader": null,
|
121
|
+
"context_type": "Course",
|
122
|
+
"course_id": 14,
|
123
|
+
"protected": false,
|
124
|
+
"allows_multiple_memberships": false,
|
125
|
+
"is_member": false
|
126
|
+
},
|
127
|
+
"has_submission": false,
|
128
|
+
"concluded": false
|
129
|
+
}
|
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.2.
|
4
|
+
version: 1.2.11
|
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: 2016-08-
|
11
|
+
date: 2016-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -223,6 +223,7 @@ files:
|
|
223
223
|
- spec/fixtures/deleted_conversation.json
|
224
224
|
- spec/fixtures/department_level_participation.json
|
225
225
|
- spec/fixtures/department_level_statistics.json
|
226
|
+
- spec/fixtures/edited_group.json
|
226
227
|
- spec/fixtures/enroll_student.json
|
227
228
|
- spec/fixtures/enrollment_terms.json
|
228
229
|
- spec/fixtures/group.json
|
@@ -235,6 +236,7 @@ files:
|
|
235
236
|
- spec/fixtures/module_items.json
|
236
237
|
- spec/fixtures/modules.json
|
237
238
|
- spec/fixtures/no_custom_data.json
|
239
|
+
- spec/fixtures/ok.json
|
238
240
|
- spec/fixtures/outcome_group_import.json
|
239
241
|
- spec/fixtures/outcome_groups.json
|
240
242
|
- spec/fixtures/outcome_result.json
|
@@ -285,7 +287,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
285
287
|
version: '0'
|
286
288
|
requirements: []
|
287
289
|
rubyforge_project:
|
288
|
-
rubygems_version: 2.5.1
|
290
|
+
rubygems_version: 2.4.5.1
|
289
291
|
signing_key:
|
290
292
|
specification_version: 4
|
291
293
|
summary: Canvas API
|
@@ -375,6 +377,7 @@ test_files:
|
|
375
377
|
- spec/fixtures/deleted_conversation.json
|
376
378
|
- spec/fixtures/department_level_participation.json
|
377
379
|
- spec/fixtures/department_level_statistics.json
|
380
|
+
- spec/fixtures/edited_group.json
|
378
381
|
- spec/fixtures/enroll_student.json
|
379
382
|
- spec/fixtures/enrollment_terms.json
|
380
383
|
- spec/fixtures/group.json
|
@@ -387,6 +390,7 @@ test_files:
|
|
387
390
|
- spec/fixtures/module_items.json
|
388
391
|
- spec/fixtures/modules.json
|
389
392
|
- spec/fixtures/no_custom_data.json
|
393
|
+
- spec/fixtures/ok.json
|
390
394
|
- spec/fixtures/outcome_group_import.json
|
391
395
|
- spec/fixtures/outcome_groups.json
|
392
396
|
- spec/fixtures/outcome_result.json
|
@@ -418,3 +422,4 @@ test_files:
|
|
418
422
|
- spec/fixtures/user_page_views.json
|
419
423
|
- spec/fixtures/user_profile.json
|
420
424
|
- spec/helper.rb
|
425
|
+
has_rdoc:
|