bridge_api 0.1.43 → 0.1.44

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
- SHA256:
3
- metadata.gz: ff20744ca9aac7746c13a3a16a750d590865907836cdfcc60a40b07c4b67cc9d
4
- data.tar.gz: 8dd43a5f6b7306fd893e5ebb0555b793a3c5a3fe851211841d2acd584f54df89
2
+ SHA1:
3
+ metadata.gz: eb7ff440d73cd59bb5c89d5d8b0e68845f7baf5f
4
+ data.tar.gz: 15a0b192992561f3606910388e0b21a3729c673c
5
5
  SHA512:
6
- metadata.gz: 15e7375a4c75a5d3dbe046945f47f4a36a754b61fc51a6a52d405b31415fdc8f75d47a66bdc90385f2ff8dbd23e214f93b8fe29e333e091f5de1bc28bf1b3a59
7
- data.tar.gz: 2c3e1edc68e0497c23d79bfeaf775220edfb6c3001c57d9432612c857b26dd407441aa5e7d84263e0b0940bf105002db7e84f6cea1ef491419cc0398190a40df
6
+ metadata.gz: ce3503db06918b1a785c3eccb272372882ab0e17cce576050e2b6fe529593abd87d06f06d8d38a0bb2d47370b238677ea18fcd753abc41f02aad0c0febd82f4a
7
+ data.tar.gz: 90108fd33c24aa1c4b021ed2369e8507de046ebcdfd9affd5f6e557cbc01c1e0bc009496625a68935d49b1048435434ef2b16584d3b082b6f696ddceef66e397
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bridge_api (0.1.41)
4
+ bridge_api (0.1.44)
5
5
  faraday (~> 0.9.0)
6
6
  faraday_middleware (~> 0.9.0)
7
7
  footrest (>= 0.5.1)
@@ -32,7 +32,7 @@ GEM
32
32
  faraday (>= 0.9.0, < 1)
33
33
  link_header (>= 0.0.7)
34
34
  hashdiff (0.3.7)
35
- i18n (1.1.0)
35
+ i18n (1.1.1)
36
36
  concurrent-ruby (~> 1.0)
37
37
  link_header (0.0.8)
38
38
  little-plugger (1.1.4)
@@ -1,6 +1,10 @@
1
1
  module BridgeAPI
2
2
  class Client
3
3
  module Affiliation
4
+ def list_affiliations(params = {})
5
+ get("#{API_PATH}#{AUTHOR_PATH}#{AFFILIATED_SUBACCOUNTS}", params)
6
+ end
7
+
4
8
  def revoke_affiliations_batch(params = {})
5
9
  put("#{API_PATH}#{AUTHOR_PATH}#{AFFILIATED_SUBACCOUNTS}/revoke_batch", params)
6
10
  end
@@ -11,4 +15,3 @@ module BridgeAPI
11
15
  end
12
16
  end
13
17
  end
14
-
@@ -1,3 +1,3 @@
1
1
  module BridgeAPI
2
- VERSION = '0.1.43'.freeze unless defined?(BridgeAPI::VERSION)
2
+ VERSION = '0.1.44'.freeze unless defined?(BridgeAPI::VERSION)
3
3
  end
@@ -0,0 +1,18 @@
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 list the affiliations' do
9
+ response = @client.list_affiliations({item_id: 1, item_type: 'CourseTemple'})
10
+ expect(response.status).to(eq(204))
11
+ end
12
+
13
+ it 'should share the affiliation in bulk' do
14
+ response = @client.share_affiliations_batch
15
+ expect(response.status).to(eq(204))
16
+ end
17
+
18
+ end
@@ -1,13 +1,13 @@
1
1
  {
2
- "meta": {},
3
- "sub_accounts": [
4
- {
5
- "id": "1",
6
- "name": "SubAccount",
7
- "affiliated": false,
8
- "has_enrollments": false,
9
- "has_foreign_sources": false,
10
- "user_count": 1
11
- }
12
- ]
13
- }
2
+ "meta": {},
3
+ "sub_accounts": [
4
+ {
5
+ "id": "1",
6
+ "name": "SubAccount",
7
+ "affiliated": false,
8
+ "has_enrollments": false,
9
+ "has_foreign_sources": false,
10
+ "user_count": 1
11
+ }
12
+ ]
13
+ }
@@ -262,6 +262,10 @@ class FakeBridge < Sinatra::Base
262
262
  end
263
263
 
264
264
  #Affiliations
265
+ get %r{/api/author/affiliated_sub_accounts} do
266
+ get_json_data 204, 'affiliations.json'
267
+ end
268
+
265
269
  put %r{/api/author/affiliated_sub_accounts} do
266
270
  get_json_data 204, 'affiliations.json'
267
271
  end
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.43
4
+ version: 0.1.44
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-10-15 00:00:00.000000000 Z
11
+ date: 2018-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -227,7 +227,7 @@ files:
227
227
  - lib/bridge_api/client/user.rb
228
228
  - lib/bridge_api/version.rb
229
229
  - spec/bridge_api/client/account_spec.rb
230
- - spec/bridge_api/client/affiliations.rb
230
+ - spec/bridge_api/client/affiliations_spec.rb
231
231
  - spec/bridge_api/client/clone_object_spec.rb
232
232
  - spec/bridge_api/client/course_template_spec.rb
233
233
  - spec/bridge_api/client/custom_field_spec.rb
@@ -292,13 +292,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
292
292
  version: '0'
293
293
  requirements: []
294
294
  rubyforge_project:
295
- rubygems_version: 2.7.3
295
+ rubygems_version: 2.6.14
296
296
  signing_key:
297
297
  specification_version: 4
298
298
  summary: Bridge API
299
299
  test_files:
300
300
  - spec/bridge_api/client/account_spec.rb
301
- - spec/bridge_api/client/affiliations.rb
301
+ - spec/bridge_api/client/affiliations_spec.rb
302
302
  - spec/bridge_api/client/clone_object_spec.rb
303
303
  - spec/bridge_api/client/course_template_spec.rb
304
304
  - spec/bridge_api/client/custom_field_spec.rb
@@ -343,3 +343,4 @@ test_files:
343
343
  - spec/fixtures/users.json
344
344
  - spec/support/fake_bridge.rb
345
345
  - spec/test_helper.rb
346
+ has_rdoc:
@@ -1,13 +0,0 @@
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