bridge_api 0.1.27 → 0.1.29
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/bridge_api/client.rb +1 -0
- data/lib/bridge_api/client/affiliation.rb +14 -0
- data/lib/bridge_api/version.rb +1 -1
- data/spec/bridge_api/client/affiliations.rb +13 -0
- data/spec/fixtures/affiliations.json +13 -0
- data/spec/support/fake_bridge.rb +5 -0
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 714ebb0ae6cc3228e944e53ec5deb352bec2881c
|
4
|
+
data.tar.gz: 3be3ac1bb97b2ef0f252c526a9dbee364455a9f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c8e9e43b293e203687f58a8bbed1757b14571fa026fb78bdfbb747b6e19d249986344c4e2dc043e7f14c98b572699b5ed485664be30e3860eaa20d76be7d8c6
|
7
|
+
data.tar.gz: a4ed080334833e1d52ed7ef83cff466167341c1261c90fe8872082ea5fbbc3d80b59d57afa5d395a622a0fddd9781f6277bb7e45bd43eeecf9335b18c90844ab
|
data/Gemfile.lock
CHANGED
data/lib/bridge_api/client.rb
CHANGED
@@ -0,0 +1,14 @@
|
|
1
|
+
module BridgeAPI
|
2
|
+
class Client
|
3
|
+
module Affiliation
|
4
|
+
def revoke_affiliations_batch(params = {})
|
5
|
+
put("#{API_PATH}#{AUTHOR_PATH}#{AFFILIATED_SUBACCOUNTS}/revoke_batch", params)
|
6
|
+
end
|
7
|
+
|
8
|
+
def share_affiliations_batch(course_template_id, params = {})
|
9
|
+
put("#{API_PATH}#{AUTHOR_PATH}#{AFFILIATED_SUBACCOUNTS}/share_batch", params)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
data/lib/bridge_api/version.rb
CHANGED
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
describe BridgeAPI::Client::Affiliation do
|
4
|
+
before do
|
5
|
+
@client = BridgeAPI::Client.new(prefix: 'http://test.bridge.com', token: 'test_token')
|
6
|
+
end
|
7
|
+
|
8
|
+
it 'should share the affiliation in bulk' do
|
9
|
+
response = @client.share_affiliations_batch.first
|
10
|
+
expect(response['id']).to(eq('12'))
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
data/spec/support/fake_bridge.rb
CHANGED
@@ -214,6 +214,11 @@ class FakeBridge < Sinatra::Base
|
|
214
214
|
get_json_data 204, 'roles.json'
|
215
215
|
end
|
216
216
|
|
217
|
+
#Affiliations
|
218
|
+
put %r{/api/author/affiliated_sub_accounts} do
|
219
|
+
get_json_data 204, 'affiliations.json'
|
220
|
+
end
|
221
|
+
|
217
222
|
private
|
218
223
|
|
219
224
|
def get_json_data(response_code, file_name)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bridge_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.29
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jay Shaffer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -195,6 +195,7 @@ files:
|
|
195
195
|
- lib/bridge_api/api_array.rb
|
196
196
|
- lib/bridge_api/client.rb
|
197
197
|
- lib/bridge_api/client/account.rb
|
198
|
+
- lib/bridge_api/client/affiliation.rb
|
198
199
|
- lib/bridge_api/client/clone_object.rb
|
199
200
|
- lib/bridge_api/client/course_template.rb
|
200
201
|
- lib/bridge_api/client/custom_field.rb
|
@@ -210,6 +211,7 @@ files:
|
|
210
211
|
- lib/bridge_api/client/user.rb
|
211
212
|
- lib/bridge_api/version.rb
|
212
213
|
- spec/bridge_api/client/account_spec.rb
|
214
|
+
- spec/bridge_api/client/affiliations.rb
|
213
215
|
- spec/bridge_api/client/clone_object_spec.rb
|
214
216
|
- spec/bridge_api/client/course_template_spec.rb
|
215
217
|
- spec/bridge_api/client/custom_field_spec.rb
|
@@ -225,6 +227,7 @@ files:
|
|
225
227
|
- spec/bridge_api/client/user_spec.rb
|
226
228
|
- spec/bridge_api/client_spec.rb
|
227
229
|
- spec/fixtures/accounts.json
|
230
|
+
- spec/fixtures/affiliations.json
|
228
231
|
- spec/fixtures/clone_objects.json
|
229
232
|
- spec/fixtures/course.json
|
230
233
|
- spec/fixtures/courses.json
|
@@ -275,6 +278,7 @@ specification_version: 4
|
|
275
278
|
summary: Bridge API
|
276
279
|
test_files:
|
277
280
|
- spec/bridge_api/client/account_spec.rb
|
281
|
+
- spec/bridge_api/client/affiliations.rb
|
278
282
|
- spec/bridge_api/client/clone_object_spec.rb
|
279
283
|
- spec/bridge_api/client/course_template_spec.rb
|
280
284
|
- spec/bridge_api/client/custom_field_spec.rb
|
@@ -290,6 +294,7 @@ test_files:
|
|
290
294
|
- spec/bridge_api/client/user_spec.rb
|
291
295
|
- spec/bridge_api/client_spec.rb
|
292
296
|
- spec/fixtures/accounts.json
|
297
|
+
- spec/fixtures/affiliations.json
|
293
298
|
- spec/fixtures/clone_objects.json
|
294
299
|
- spec/fixtures/course.json
|
295
300
|
- spec/fixtures/courses.json
|