bridge_api 0.1.22 → 0.1.24

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
- SHA256:
3
- metadata.gz: '015874326c09a90bd78033b8960c07797da6c983eefbf41fb039d7dd187618cf'
4
- data.tar.gz: eb8dc80183260096aa252c2efd771542e72cc27cde7339619c5aca35460305b5
2
+ SHA1:
3
+ metadata.gz: 41b849a3dc1ff52b4b877a7bd79df110ba14967c
4
+ data.tar.gz: b78071208feaba95390d8a922b3803773bcdd9f1
5
5
  SHA512:
6
- metadata.gz: e043912c7200fe1805032ab8b7095e471f7886b5b0687253aa24394db7f676311d9cfed5f39c18a5f0f2a09c475bd54ce3199dd3b6bc7f7327c8a9dacd8d82af
7
- data.tar.gz: 8559e3a7b584c9fb2c5da6cdaff7ac4ae06821afcef00a172abc4e796520afd0c360414e31f5209302523c7fe1bea5a0bb9eed57c9f7c8405cc9ee85461ebd57
6
+ metadata.gz: c5acc23051ae8843ed7e5f9b45e5b5d02df997594e8fecca38842b49b155884eba60a334ffc58afb5df4624256a5c5fb36879c6f803c5b84ccf625e44a164033
7
+ data.tar.gz: c8bf74dcd83c059cdf34e2b7160f41af35db5062919da46df8a92d36d7e55bf0e09d9b0e0a06753509f5393305cc3a4d94528a33c4346cbdd3752a71951b1c11
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bridge_api (0.1.21)
4
+ bridge_api (0.1.24)
5
5
  faraday (~> 0.9.0)
6
6
  faraday_middleware (~> 0.9.0)
7
7
  footrest (>= 0.5.1)
@@ -9,9 +9,9 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- activesupport (5.2.0)
12
+ activesupport (5.1.5)
13
13
  concurrent-ruby (~> 1.0, >= 1.0.2)
14
- i18n (>= 0.7, < 2)
14
+ i18n (~> 0.7)
15
15
  minitest (~> 5.1)
16
16
  tzinfo (~> 1.1)
17
17
  addressable (2.5.1)
@@ -31,7 +31,7 @@ GEM
31
31
  faraday (~> 0.9.0)
32
32
  link_header (>= 0.0.7)
33
33
  hashdiff (0.3.2)
34
- i18n (1.0.1)
34
+ i18n (0.9.5)
35
35
  concurrent-ruby (~> 1.0)
36
36
  link_header (0.0.8)
37
37
  method_source (0.8.2)
@@ -13,6 +13,7 @@ module BridgeAPI
13
13
  DATA_DUMP_PATH = '/data_dumps'.freeze
14
14
  COURSE_TEMPLATE_PATH = '/course_templates'.freeze
15
15
  ENROLLMENT_PATH = '/enrollments'.freeze
16
+ LTI_TOOLS_PATH = '/lti_tools'.freeze
16
17
  PROGRAM_PATH = '/programs'.freeze
17
18
  PROGRAM_ENROLLMENT_PATH = '/learners'.freeze
18
19
  USER_PATH = '/users'.freeze
@@ -4,6 +4,10 @@ module BridgeAPI
4
4
  def update_account(account_id, params = {})
5
5
  put("#{API_PATH}#{SUPPORT_PATH}#{ACCOUNT_PATH}/#{account_id}", params)
6
6
  end
7
+
8
+ def update_account_lti_config(account_id, lti_tool_id, params = {})
9
+ put("#{API_PATH}#{SUPPORT_PATH}#{ACCOUNT_PATH}/#{account_id}#{LTI_TOOLS_PATH}/#{lti_tool_id}", params)
10
+ end
7
11
  end
8
12
  end
9
13
  end
@@ -24,6 +24,10 @@ module BridgeAPI
24
24
  def revoke_course_from_subaccount(course_template_id, params = {})
25
25
  put("#{API_PATH}#{AUTHOR_PATH}#{COURSE_TEMPLATE_PATH}/#{course_template_id}/#{SUB_ACCOUNT_PATH}/revoke", params)
26
26
  end
27
+
28
+ def update_sub_account_lti_config(sub_account_id, lti_tool_id, params = {})
29
+ put("#{API_PATH}#{SUPPORT_PATH}#{SUB_ACCOUNT_PATH}/#{sub_account_id}#{LTI_TOOLS_PATH}/#{lti_tool_id}", params)
30
+ end
27
31
  end
28
32
  end
29
33
  end
@@ -1,3 +1,3 @@
1
1
  module BridgeAPI
2
- VERSION = '0.1.22'.freeze unless defined?(BridgeAPI::VERSION)
2
+ VERSION = '0.1.24'.freeze unless defined?(BridgeAPI::VERSION)
3
3
  end
@@ -11,4 +11,11 @@ describe BridgeAPI::Client::CourseTemplate do
11
11
  templates = @client.update_account(1)
12
12
  expect(templates.status).to(eq(200))
13
13
  end
14
+
15
+
16
+ it 'should update the lti config' do
17
+ params = {lti_tool: {consumer_key: "YoooKey", shared_secret: SecureRandom.hex(16)}}
18
+ response = @client.update_account_lti_config(2, 15, params)
19
+ expect(response.status).to(eq 200)
20
+ end
14
21
  end
@@ -22,4 +22,10 @@ describe BridgeAPI::Client::SubAccount do
22
22
  response = @client.deactivate_sub_account(1)
23
23
  expect(response.first['id']).to(eq('141'))
24
24
  end
25
+
26
+ it 'should update the lti config' do
27
+ params = {lti_tool: {consumer_key: "YoooKey", shared_secret: SecureRandom.hex(16)}}
28
+ response = @client.update_sub_account_lti_config(2, 15, params)
29
+ expect(response.status).to(eq 200)
30
+ end
25
31
  end
@@ -174,11 +174,19 @@ class FakeBridge < Sinatra::Base
174
174
  get_json_data 200, 'sub_accounts.json'
175
175
  end
176
176
 
177
+ put %r{/api/support/sub_accounts/\d+/lti_tools/\d+} do
178
+ get_json_data 200, 'accounts.json'
179
+ end
180
+
177
181
  # Accounts
178
182
  put %r{/api/support/accounts} do
179
183
  get_json_data 200, 'accounts.json'
180
184
  end
181
185
 
186
+ put %r{/api/support/accounts/\d+/lti_tools/\d+} do
187
+ get_json_data 200, 'accounts.json'
188
+ end
189
+
182
190
  private
183
191
 
184
192
  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.22
4
+ version: 0.1.24
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-05-14 00:00:00.000000000 Z
11
+ date: 2018-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -261,7 +261,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
261
261
  version: '0'
262
262
  requirements: []
263
263
  rubyforge_project:
264
- rubygems_version: 2.7.3
264
+ rubygems_version: 2.6.14
265
265
  signing_key:
266
266
  specification_version: 4
267
267
  summary: Bridge API
@@ -299,3 +299,4 @@ test_files:
299
299
  - spec/fixtures/users.json
300
300
  - spec/support/fake_bridge.rb
301
301
  - spec/test_helper.rb
302
+ has_rdoc: