bridge_api 0.1.25 → 0.1.26
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bridge_api/client/account.rb +0 -4
- data/lib/bridge_api/client/sub_account.rb +4 -0
- data/lib/bridge_api/version.rb +1 -1
- data/spec/bridge_api/client/account_spec.rb +0 -7
- data/spec/bridge_api/client/sub_account_spec.rb +6 -1
- data/spec/fixtures/sub_account_lti_config.json +9 -0
- data/spec/fixtures/sub_account_lti_config_update.json +4 -0
- data/spec/support/fake_bridge.rb +5 -5
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb2cd7d2e2a8d97e6208fd6632e8173b887b3f20
|
4
|
+
data.tar.gz: e51fe0b7a828425949945f66c0d2b878f1c3c66a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c6e545210b976756053fee121b2e937f82900b17e00c76f05b7d87781de83fe0be29a4771ac0707591437ec12b0ff375f53201048f4e12d4b78648932a46d63
|
7
|
+
data.tar.gz: 0c260c24d9653f688e84a89a14debeb4c8f25acf1953dc754b708602e7384db9aac65eb269447c734231979ff48413ff7956025d756c4c99c2d8219bf90c0525
|
@@ -4,10 +4,6 @@ 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
|
11
7
|
end
|
12
8
|
end
|
13
9
|
end
|
@@ -25,6 +25,10 @@ module BridgeAPI
|
|
25
25
|
put("#{API_PATH}#{AUTHOR_PATH}#{COURSE_TEMPLATE_PATH}/#{course_template_id}/#{SUB_ACCOUNT_PATH}/revoke", params)
|
26
26
|
end
|
27
27
|
|
28
|
+
def get_lti_config_for_sub_account(sub_account_id, params = {})
|
29
|
+
get("#{API_PATH}#{SUPPORT_PATH}#{SUB_ACCOUNT_PATH}/#{sub_account_id}#{LTI_TOOLS_PATH}", params)
|
30
|
+
end
|
31
|
+
|
28
32
|
def update_sub_account_lti_config(sub_account_id, lti_tool_id, params = {})
|
29
33
|
put("#{API_PATH}#{SUPPORT_PATH}#{SUB_ACCOUNT_PATH}/#{sub_account_id}#{LTI_TOOLS_PATH}/#{lti_tool_id}", params)
|
30
34
|
end
|
data/lib/bridge_api/version.rb
CHANGED
@@ -11,11 +11,4 @@ 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
|
21
14
|
end
|
@@ -23,9 +23,14 @@ describe BridgeAPI::Client::SubAccount do
|
|
23
23
|
expect(response.first['id']).to(eq('141'))
|
24
24
|
end
|
25
25
|
|
26
|
+
it 'should get all the lti config' do
|
27
|
+
response = @client.get_lti_config_for_sub_account(1)
|
28
|
+
expect(response.body['lti_tools'].first['id']).to(eq('100'))
|
29
|
+
end
|
30
|
+
|
26
31
|
it 'should update the lti config' do
|
27
32
|
params = {lti_tool: {consumer_key: "YoooKey", shared_secret: SecureRandom.hex(16)}}
|
28
33
|
response = @client.update_sub_account_lti_config(2, 15, params)
|
29
|
-
expect(response.
|
34
|
+
expect(response.body['lti_tool']['id']).to(eq '20')
|
30
35
|
end
|
31
36
|
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
{
|
2
|
+
"sub_account_id":"2",
|
3
|
+
"lti_tools":[
|
4
|
+
{"id":"100","name":"Learner-LTI","tool_enabled":true,"created_at":"2018-04-20T11:06:32.731-06:00","updated_at":"2018-04-20T12:04:33.214-06:00"},
|
5
|
+
{"id":"101","name":"New Transcript Tool","tool_enabled":true,"created_at":"2018-04-20T12:10:20.952-06:00","updated_at":"2018-04-20T12:10:22.276-06:00"},
|
6
|
+
{"id":"102","name":"Support Tools","tool_enabled":true,"created_at":"2018-04-20T12:12:29.518-06:00","updated_at":"2018-04-20T12:12:31.208-06:00"},
|
7
|
+
{"id":"103","name":"test","tool_enabled":true,"created_at":"2018-05-17T13:41:55.287-06:00","updated_at":"2018-05-17T13:44:58.758-06:00"}
|
8
|
+
]
|
9
|
+
}
|
@@ -0,0 +1,4 @@
|
|
1
|
+
{
|
2
|
+
"sub_account_id":"2",
|
3
|
+
"lti_tool":{"id":"20","name":"test","tool_enabled":true,"created_at":"2018-05-17T13:41:55.287-06:00","updated_at":"2018-05-17T14:24:27.790-06:00","xml_configuration":"\u003ccartridge_basiclti_link xmlns=\"http://www.imsglobal.org/xsd/imslticc_v1p0\" xmlns:blti=\"http://www.imsglobal.org/xsd/imsbasiclti_v1p0\" xmlns:lticm=\"http://www.imsglobal.org/xsd/imslticm_v1p0\" xmlns:lticp=\"http://www.imsglobal.org/xsd/imslticp_v1p0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.imsglobal.org/xsd/imslticc_v1p0 http://www.imsglobal.org/xsd/lti/ltiv1p0/imslticc_v1p0.xsd http://www.imsglobal.org/xsd/imsbasiclti_v1p0 http://www.imsglobal.org/xsd/lti/ltiv1p0/imsbasiclti_v1p0p1.xsd http://www.imsglobal.org/xsd/imslticm_v1p0 http://www.imsglobal.org/xsd/lti/ltiv1p0/imslticm_v1p0.xsd http://www.imsglobal.org/xsd/imslticp_v1p0 http://www.imsglobal.org/xsd/lti/ltiv1p0/imslticp_v1p0.xsd\"\u003e\u003cblti:title\u003ePaychex Transcript\u003c/blti:title\u003e\u003cblti:description\u003ePaychex Transcript Tool\u003c/blti:description\u003e\u003cblti:launch_url\u003ehttp://localhost:3009\u003c/blti:launch_url\u003e\u003cblti:secure_launch_url\u003ehttp://localhost:3009\u003c/blti:secure_launch_url\u003e\u003cblti:extensions platform=\"bridgeapp.com\"\u003e\u003clticm:property name=\"domain\"\u003ehttp://localhost:3009\u003c/lticm:property\u003e\u003clticm:options name=\"learner_nav\"\u003e\u003clticm:property name=\"text\"\u003ePaychex Transcript Tools\u003c/lticm:property\u003e\u003clticm:property name=\"url\"\u003ehttp://localhost:3009/transcript/lti_launch\u003c/lticm:property\u003e\u003c/lticm:options\u003e\u003c/blti:extensions\u003e\u003c/cartridge_basiclti_link\u003e","description":"Paychex Transcript Tool","consumer_key":"KEYkey","shared_secret":"95f14f72e87b8519a9fa8056a08736a4"}
|
4
|
+
}
|
data/spec/support/fake_bridge.rb
CHANGED
@@ -184,8 +184,12 @@ class FakeBridge < Sinatra::Base
|
|
184
184
|
get_json_data 200, 'sub_accounts.json'
|
185
185
|
end
|
186
186
|
|
187
|
+
get %r{/api/support/sub_accounts/\d+/lti_tools} do
|
188
|
+
get_json_data 200, 'sub_account_lti_config.json'
|
189
|
+
end
|
190
|
+
|
187
191
|
put %r{/api/support/sub_accounts/\d+/lti_tools/\d+} do
|
188
|
-
get_json_data 200, '
|
192
|
+
get_json_data 200, 'sub_account_lti_config_update.json'
|
189
193
|
end
|
190
194
|
|
191
195
|
# Accounts
|
@@ -193,10 +197,6 @@ class FakeBridge < Sinatra::Base
|
|
193
197
|
get_json_data 200, 'accounts.json'
|
194
198
|
end
|
195
199
|
|
196
|
-
put %r{/api/support/accounts/\d+/lti_tools/\d+} do
|
197
|
-
get_json_data 200, 'accounts.json'
|
198
|
-
end
|
199
|
-
|
200
200
|
private
|
201
201
|
|
202
202
|
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.26
|
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-
|
11
|
+
date: 2018-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -239,6 +239,8 @@ files:
|
|
239
239
|
- spec/fixtures/managers.json
|
240
240
|
- spec/fixtures/program_enrollments.json
|
241
241
|
- spec/fixtures/programs.json
|
242
|
+
- spec/fixtures/sub_account_lti_config.json
|
243
|
+
- spec/fixtures/sub_account_lti_config_update.json
|
242
244
|
- spec/fixtures/sub_accounts.json
|
243
245
|
- spec/fixtures/user.json
|
244
246
|
- spec/fixtures/users.json
|
@@ -299,6 +301,8 @@ test_files:
|
|
299
301
|
- spec/fixtures/managers.json
|
300
302
|
- spec/fixtures/program_enrollments.json
|
301
303
|
- spec/fixtures/programs.json
|
304
|
+
- spec/fixtures/sub_account_lti_config.json
|
305
|
+
- spec/fixtures/sub_account_lti_config_update.json
|
302
306
|
- spec/fixtures/sub_accounts.json
|
303
307
|
- spec/fixtures/user.json
|
304
308
|
- spec/fixtures/users.json
|