bearcat 1.3.6 → 1.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cc775dfa487694db27435067e262d2b9359713c1
4
- data.tar.gz: a8737f4b71fef078a81c413eddcec18828d64dff
3
+ metadata.gz: 410afb8f6177bf3e635f0fb7abc8dfd9e3f431ab
4
+ data.tar.gz: a781a8b4ec7c352bc07a3fd87728916e3e92525a
5
5
  SHA512:
6
- metadata.gz: d3fb9fbfb98f847bca2b32aa216ed9385166f64b957cdf7fe75344b88d2d17f93b44cb5eeac3fca611d7cbe267c7349d13b66805f6f02cb0181ba524ef905069
7
- data.tar.gz: 487c81bae17bf65dd3207cd4cd9d29c0de81052f990cde2bdb5e80a80ea9424b9aa7477fcc893c3fa05b3981fbdd7875e367b13d25521d5d596aade051e70947
6
+ metadata.gz: 45e8c284733d60f869cdb5715c7e547a17df4c54c073aa74a74166ce52ccae9c4c01305f2277fc50c9d59e6e73ad4b74e9a40d0e60707a048e8d584b39ee642d
7
+ data.tar.gz: 6145d78ce605af64cb9126b1a148c2439a4cb4e94fe54e9b3257705223cb91d74e86e4fbcbd3dfbafc0b142f765ab5561a69526ce09828b7be5b9f9e775b5422
@@ -18,6 +18,18 @@ module Bearcat
18
18
  get("/api/v1/accounts/#{account}/admins", params)
19
19
  end
20
20
 
21
+ def create_account_admin(account, params = {})
22
+ post("/api/v1/accounts/#{account}/admins", params)
23
+ end
24
+
25
+ def delete_account_admin(account, user, params = {})
26
+ delete("/api/v1/accounts/#{account}/admins/#{user}", params)
27
+ end
28
+
29
+ def list_roles(account, params = {})
30
+ get("/api/v1/accounts/#{account}/roles")
31
+ end
32
+
21
33
  def account_roles(account, params = {})
22
34
  get("/api/v1/accounts/#{account}/roles", params)
23
35
  end
@@ -1,3 +1,3 @@
1
1
  module Bearcat
2
- VERSION = '1.3.6' unless defined?(Bearcat::VERSION)
2
+ VERSION = '1.3.7' unless defined?(Bearcat::VERSION)
3
3
  end
@@ -62,4 +62,18 @@ describe Bearcat::Client::Accounts do
62
62
  expect(grading_standards['title']).to eq 'account grading scheme'
63
63
  end
64
64
 
65
+ it 'creates an account admin' do
66
+ stub_post(@client, "/api/v1/accounts/1/admins").to_return(json_response("account_admin_create.json"))
67
+ account_admin = @client.create_account_admin(1, {role_id:1, user_id: "sis_user_id:user1_sis_id"})
68
+ expect(account_admin['id']).to eq 99
69
+ expect(account_admin['role']).to eq 'AccountAdmin'
70
+ end
71
+
72
+ it 'deletes an account admin' do
73
+ stub_delete(@client, "/api/v1/accounts/1/admins/sis_user_id:user1_sis_id?role_id=1").to_return(json_response("account_admin_delete.json"))
74
+ account_admin = @client.delete_account_admin(1, "sis_user_id:user1_sis_id", {role_id:1})
75
+ expect(account_admin['id']).to eq 99
76
+ expect(account_admin['status']).to eq 'deleted'
77
+ end
78
+
65
79
  end
@@ -0,0 +1,14 @@
1
+ {
2
+ "id": 99,
3
+ "role": "AccountAdmin",
4
+ "role_id": 1,
5
+ "user": {
6
+ "id": 1575,
7
+ "name": "Dummy User 4",
8
+ "sortable_name": "4, Dummy User",
9
+ "short_name": "Dummy User 4",
10
+ "sis_user_id": "user1_sis_id",
11
+ "sis_login_id": "dummy_user_4",
12
+ "login_id": "dummy_user_4"
13
+ }
14
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "id": 99,
3
+ "role": "AccountAdmin",
4
+ "role_id": 1,
5
+ "user": {
6
+ "id": 1575,
7
+ "name": "Dummy User 4",
8
+ "sortable_name": "4, Dummy User",
9
+ "short_name": "Dummy User 4",
10
+ "sis_user_id": "user1_sis_id",
11
+ "sis_login_id": "dummy_user_4",
12
+ "login_id": "dummy_user_4"
13
+ },
14
+ "status": "deleted"
15
+ }
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.6
4
+ version: 1.3.7
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-01-17 00:00:00.000000000 Z
11
+ date: 2017-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -172,6 +172,8 @@ files:
172
172
  - spec/bearcat/group_memberships_spec.rb
173
173
  - spec/bearcat_spec.rb
174
174
  - spec/fixtures/access_token.json
175
+ - spec/fixtures/account_admin_create.json
176
+ - spec/fixtures/account_admin_delete.json
175
177
  - spec/fixtures/account_admins.json
176
178
  - spec/fixtures/account_courses.json
177
179
  - spec/fixtures/account_grading_standards.json
@@ -343,6 +345,8 @@ test_files:
343
345
  - spec/bearcat/group_memberships_spec.rb
344
346
  - spec/bearcat_spec.rb
345
347
  - spec/fixtures/access_token.json
348
+ - spec/fixtures/account_admin_create.json
349
+ - spec/fixtures/account_admin_delete.json
346
350
  - spec/fixtures/account_admins.json
347
351
  - spec/fixtures/account_courses.json
348
352
  - spec/fixtures/account_grading_standards.json