scorm_engine 0.7.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/scorm_engine/api/endpoints.rb +4 -0
- data/lib/scorm_engine/api/endpoints/configuration.rb +64 -0
- data/lib/scorm_engine/api/endpoints/courses/configuration.rb +1 -1
- data/lib/scorm_engine/api/endpoints/dispatches.rb +45 -2
- data/lib/scorm_engine/api/endpoints/registrations/configuration.rb +1 -1
- data/lib/scorm_engine/api/endpoints/tenants/configuration.rb +108 -0
- data/lib/scorm_engine/configuration.rb +4 -2
- data/lib/scorm_engine/faraday/connection.rb +10 -4
- data/lib/scorm_engine/faraday/request.rb +17 -4
- data/lib/scorm_engine/models.rb +2 -0
- data/lib/scorm_engine/models/dispatch_registration_count.rb +49 -0
- data/lib/scorm_engine/models/tenant_configuration.rb +34 -0
- data/lib/scorm_engine/version.rb +1 -1
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Configuration/_get_app_configuration/is_successful.yml +64 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Configuration/_get_app_configuration/returns_settings_and_values.yml +64 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Configuration/_post_app_configuration/fails_when_settings_are_invalid.yml +48 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Configuration/_post_app_configuration/is_successful.yml +44 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Configuration/_post_app_configuration/persists_the_settings.yml +207 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses_Import/_get_course_import/successful_imports/works.yml +6 -6
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses_Import/_get_course_import/unsuccessful_imports/fails_to_import_given_an_invalid_url.yml +7 -7
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses_Import/_post_course_import/unsuccessful_imports/fails_to_import_a_previously_existing_course.yml +2 -2
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_delete_dispatch_registration_count/is_successful.yml +30 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_delete_dispatch_registration_count/succeeds_even_when_id_is_invalid.yml +30 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatch_registration_count/fails_when_id_is_invalid.yml +63 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatch_registration_count/is_successful.yml +63 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatch_registration_count/results/sucessfully_creates_the_dispatch_attributes.yml +63 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatch_registration_count/when_dispatch_has_registrations/knows_it_s_registration_count.yml +63 -0
- data/spec/scorm_engine/api/endpoints/configuration_spec.rb +51 -0
- data/spec/scorm_engine/api/endpoints/courses/import_spec.rb +1 -1
- data/spec/scorm_engine/api/endpoints/dispatches_spec.rb +47 -1
- data/spec/scorm_engine/api/endpoints/tenants/configuration_spec.rb +126 -0
- data/spec/scorm_engine/faraday/connection_spec.rb +23 -5
- data/spec/scorm_engine/models/dispatch_registration_count_spec.rb +42 -0
- data/spec/scorm_engine/models/tenant_configuration_spec.rb +16 -0
- data/spec/support/scorm_engine.rb +1 -1
- data/spec/support/vcr.rb +1 -0
- metadata +33 -12
@@ -5,7 +5,7 @@ http_interactions:
|
|
5
5
|
uri: https://<SCORM_ENGINE_HOST>/ScormEngineInterface/api/v1/ScormEngineGemTesting-default/courses/importJobs?course=an-invalid-course-url&mayCreateNewVersion=true
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string: '{"courseName":"an-invalid-course-url","url":"https://github.com/
|
8
|
+
string: '{"courseName":"an-invalid-course-url","url":"https://github.com/instructure-bridge/scorm_engine/raw/master/spec/fixtures/zip/non-existent-key.zip"}'
|
9
9
|
headers:
|
10
10
|
User-Agent:
|
11
11
|
- ScormEngine Ruby Gem 0.6.3
|
@@ -33,7 +33,7 @@ http_interactions:
|
|
33
33
|
body:
|
34
34
|
encoding: ASCII-8BIT
|
35
35
|
string: '{"result":"151cfd1f-8761-4b21-9d7a-972d99b8fd59","importResult":{"status":"RUNNING","parserWarnings":[],"courseLanguages":[]}}'
|
36
|
-
http_version:
|
36
|
+
http_version:
|
37
37
|
recorded_at: Mon, 10 Sep 2018 17:29:15 GMT
|
38
38
|
- request:
|
39
39
|
method: get
|
@@ -66,7 +66,7 @@ http_interactions:
|
|
66
66
|
body:
|
67
67
|
encoding: ASCII-8BIT
|
68
68
|
string: '{"status":"RUNNING","parserWarnings":[],"courseLanguages":[]}'
|
69
|
-
http_version:
|
69
|
+
http_version:
|
70
70
|
recorded_at: Mon, 10 Sep 2018 17:29:15 GMT
|
71
71
|
- request:
|
72
72
|
method: get
|
@@ -98,7 +98,7 @@ http_interactions:
|
|
98
98
|
- Close
|
99
99
|
body:
|
100
100
|
encoding: ASCII-8BIT
|
101
|
-
string: '{"jobId":"151cfd1f-8761-4b21-9d7a-972d99b8fd59","status":"ERROR","message":"https://github.com/
|
101
|
+
string: '{"jobId":"151cfd1f-8761-4b21-9d7a-972d99b8fd59","status":"ERROR","message":"https://github.com/instructure-bridge/scorm_engine/raw/master/spec/fixtures/zip/non-existent-key.zip
|
102
102
|
returned (404) <!DOCTYPE html>\n<html>\n <head>\n <meta http-equiv=\"Content-type\"
|
103
103
|
content=\"text/html; charset=utf-8\">\n <meta http-equiv=\"Content-Security-Policy\"
|
104
104
|
content=\"default-src ''none''; base-uri ''self''; connect-src ''self''; form-action
|
@@ -208,7 +208,7 @@ http_interactions:
|
|
208
208
|
href=\"/\" class=\"logo logo-img-2x\">\n <img width=\"32\" height=\"32\"
|
209
209
|
title=\"\" alt=\"\" src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bX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BUoV4749EIolKh+EiqWmqVEZlDgHks2pxHw7xTqUQw9J5NcAXOK10AGIoZ6Zli6JY6Z1Q461KoZ4NiKLHarW+KDsxlDUPHZ5zPQZqUVDPJsTqb5n9malbpAh8C2XXDLl62+WZIDFRUlNVOiwencnNU3aQEkL+cDMSoLvZo2fQB7AJssNAuFuvorlDVVkkg2I87+jo2K2QAVphDrfyViK5VqtO34OkaxXCp+7drdDBCAdubm6eidX+2WwqT5komwh4YQLk+H4aE93h8Xg2gvHekQZOGSgLZTLyDTLJ4Lx9/KZWKBSainT4Iy3FqQBfnUZR42PKQFksBr9QKVXCPusD3OiA/RkQ5kP8qV/Jl1WywAp/6+dcmPM2zL1UrUahe4JqfnWWKXIul3uUbfP8njAFLW1OFr3gdFtZ72cNH+PtQT7/brW+NXqJAHh0y9V8/U/A1U7AfwIMAD7mS3pCbuWJAAAAAElFTkSuQmCC\">\n </a>\n </div>\n\n <script
|
210
210
|
type=\"text/javascript\" src=\"/_error.js\"></script>\n </body>\n</html>\n","courseTitle":"","parserWarnings":[],"courseLanguages":[]}'
|
211
|
-
http_version:
|
211
|
+
http_version:
|
212
212
|
recorded_at: Mon, 10 Sep 2018 17:29:21 GMT
|
213
213
|
- request:
|
214
214
|
method: get
|
@@ -240,7 +240,7 @@ http_interactions:
|
|
240
240
|
- Close
|
241
241
|
body:
|
242
242
|
encoding: ASCII-8BIT
|
243
|
-
string: '{"jobId":"151cfd1f-8761-4b21-9d7a-972d99b8fd59","status":"ERROR","message":"https://github.com/
|
243
|
+
string: '{"jobId":"151cfd1f-8761-4b21-9d7a-972d99b8fd59","status":"ERROR","message":"https://github.com/instructure-bridge/scorm_engine/raw/master/spec/fixtures/zip/non-existent-key.zip
|
244
244
|
returned (404) <!DOCTYPE html>\n<html>\n <head>\n <meta http-equiv=\"Content-type\"
|
245
245
|
content=\"text/html; charset=utf-8\">\n <meta http-equiv=\"Content-Security-Policy\"
|
246
246
|
content=\"default-src ''none''; base-uri ''self''; connect-src ''self''; form-action
|
@@ -350,6 +350,6 @@ http_interactions:
|
|
350
350
|
href=\"/\" class=\"logo logo-img-2x\">\n <img width=\"32\" height=\"32\"
|
351
351
|
title=\"\" alt=\"\" src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpEQUM1QkUxRUI0MUMxMUUyQUQzREIxQzRENUFFNUM5NiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpEQUM1QkUxRkI0MUMxMUUyQUQzREIxQzRENUFFNUM5NiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0Y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TsZ7/H7/Mr3g5XdSIHyJSH1PZ+7fToyl2+ErqilgZ4NaLYB9goVGaHjR93Hv1ZrU4XDsFT20kH3PObzbWk0CgG1jacVIUnAQb9F+VexyLMzkpcLv0IJV7AHQIOCAUYHx7v5qgScmYHtTqSAyZLEJTK22Bie4iq3xsqpm4SAf9Hq9a2DnJ4uLK3SEULcdRvp3i3zHySqpficxEdsQc1NrlYXXvR+O7qASSezXB+h1SuUomgg9LL8BUoV4749EIolKh+EiqWmqVEZlDgHks2pxHw7xTqUQw9J5NcAXOK10AGIoZ6Zli6JY6Z1Q461KoZ4NiKLHarW+KDsxlDUPHZ5zPQZqUVDPJsTqb5n9malbpAh8C2XXDLl62+WZIDFRUlNVOiwencnNU3aQEkL+cDMSoLvZo2fQB7AJssNAuFuvorlDVVkkg2I87+jo2K2QAVphDrfyViK5VqtO34OkaxXCp+7drdDBCAdubm6eidX+2WwqT5komwh4YQLk+H4aE93h8Xg2gvHekQZOGSgLZTLyDTLJ4Lx9/KZWKBSainT4Iy3FqQBfnUZR42PKQFksBr9QKVXCPusD3OiA/RkQ5kP8qV/Jl1WywAp/6+dcmPM2zL1UrUahe4JqfnWWKXIul3uUbfP8njAFLW1OFr3gdFtZ72cNH+PtQT7/brW+NXqJAHh0y9V8/U/A1U7AfwIMAD7mS3pCbuWJAAAAAElFTkSuQmCC\">\n </a>\n </div>\n\n <script
|
352
352
|
type=\"text/javascript\" src=\"/_error.js\"></script>\n </body>\n</html>\n","courseTitle":"","parserWarnings":[],"courseLanguages":[]}'
|
353
|
-
http_version:
|
353
|
+
http_version:
|
354
354
|
recorded_at: Mon, 10 Sep 2018 17:29:21 GMT
|
355
355
|
recorded_with: VCR 4.0.0
|
@@ -5,7 +5,7 @@ http_interactions:
|
|
5
5
|
uri: https://<SCORM_ENGINE_HOST>/ScormEngineInterface/api/v1/ScormEngineGemTesting-default/courses/importJobs?course=a-previously-existing-course&mayCreateNewVersion=false
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string: '{"url":"https://github.com/
|
8
|
+
string: '{"url":"https://github.com/instructure-bridge/scorm_engine/raw/master/spec/fixtures/zip/RuntimeBasicCalls_SCORM20043rdEdition.zip","courseName":"a-previously-existing-course"}'
|
9
9
|
headers:
|
10
10
|
User-Agent:
|
11
11
|
- ScormEngine Ruby Gem 0.6.9
|
@@ -31,6 +31,6 @@ http_interactions:
|
|
31
31
|
body:
|
32
32
|
encoding: UTF-8
|
33
33
|
string: '{"message":"A course already exists with the specified id: ApiCourseId|a-previously-existing-course!VersionId|0"}'
|
34
|
-
http_version:
|
34
|
+
http_version:
|
35
35
|
recorded_at: Thu, 27 Sep 2018 20:03:33 GMT
|
36
36
|
recorded_with: VCR 4.0.0
|
@@ -0,0 +1,30 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: delete
|
5
|
+
uri: https://<SCORM_ENGINE_HOST>/ScormEngineInterface/api/v1/ScormEngineGemTesting-default/dispatches/testing-dispatch-id-2/registrationCount
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- ScormEngine Ruby Gem 0.7.1
|
12
|
+
Authorization:
|
13
|
+
- Basic <BASIC_AUTH>
|
14
|
+
response:
|
15
|
+
status:
|
16
|
+
code: 204
|
17
|
+
message: ''
|
18
|
+
headers:
|
19
|
+
date:
|
20
|
+
- Fri, 15 Feb 2019 22:00:32 GMT
|
21
|
+
server:
|
22
|
+
- nginx
|
23
|
+
connection:
|
24
|
+
- Close
|
25
|
+
body:
|
26
|
+
encoding: UTF-8
|
27
|
+
string: ''
|
28
|
+
http_version:
|
29
|
+
recorded_at: Fri, 15 Feb 2019 22:00:32 GMT
|
30
|
+
recorded_with: VCR 4.0.0
|
@@ -0,0 +1,30 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: delete
|
5
|
+
uri: https://<SCORM_ENGINE_HOST>/ScormEngineInterface/api/v1/ScormEngineGemTesting-default/dispatches/nonexistent-dispatch/registrationCount
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- ScormEngine Ruby Gem 0.7.1
|
12
|
+
Authorization:
|
13
|
+
- Basic <BASIC_AUTH>
|
14
|
+
response:
|
15
|
+
status:
|
16
|
+
code: 204
|
17
|
+
message: ''
|
18
|
+
headers:
|
19
|
+
date:
|
20
|
+
- Fri, 15 Feb 2019 22:00:32 GMT
|
21
|
+
server:
|
22
|
+
- nginx
|
23
|
+
connection:
|
24
|
+
- Close
|
25
|
+
body:
|
26
|
+
encoding: UTF-8
|
27
|
+
string: ''
|
28
|
+
http_version:
|
29
|
+
recorded_at: Fri, 15 Feb 2019 22:00:32 GMT
|
30
|
+
recorded_with: VCR 4.0.0
|
@@ -0,0 +1,63 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: delete
|
5
|
+
uri: https://<SCORM_ENGINE_HOST>/ScormEngineInterface/api/v1/ScormEngineGemTesting-default/dispatches/testing-dispatch-id-2/registrationCount
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- ScormEngine Ruby Gem 0.7.1
|
12
|
+
Authorization:
|
13
|
+
- Basic <BASIC_AUTH>
|
14
|
+
response:
|
15
|
+
status:
|
16
|
+
code: 204
|
17
|
+
message: ''
|
18
|
+
headers:
|
19
|
+
date:
|
20
|
+
- Fri, 15 Feb 2019 22:00:38 GMT
|
21
|
+
server:
|
22
|
+
- nginx
|
23
|
+
connection:
|
24
|
+
- Close
|
25
|
+
body:
|
26
|
+
encoding: UTF-8
|
27
|
+
string: ''
|
28
|
+
http_version:
|
29
|
+
recorded_at: Fri, 15 Feb 2019 22:00:38 GMT
|
30
|
+
- request:
|
31
|
+
method: get
|
32
|
+
uri: https://<SCORM_ENGINE_HOST>/ScormEngineInterface/api/v1/ScormEngineGemTesting-default/dispatches/nonexistent-dispatch/registrationCount
|
33
|
+
body:
|
34
|
+
encoding: US-ASCII
|
35
|
+
string: ''
|
36
|
+
headers:
|
37
|
+
User-Agent:
|
38
|
+
- ScormEngine Ruby Gem 0.7.1
|
39
|
+
Authorization:
|
40
|
+
- Basic <BASIC_AUTH>
|
41
|
+
response:
|
42
|
+
status:
|
43
|
+
code: 404
|
44
|
+
message: ''
|
45
|
+
headers:
|
46
|
+
content-type:
|
47
|
+
- application/json
|
48
|
+
date:
|
49
|
+
- Fri, 15 Feb 2019 22:00:38 GMT
|
50
|
+
server:
|
51
|
+
- nginx
|
52
|
+
vary:
|
53
|
+
- Accept-Encoding
|
54
|
+
content-length:
|
55
|
+
- '77'
|
56
|
+
connection:
|
57
|
+
- Close
|
58
|
+
body:
|
59
|
+
encoding: ASCII-8BIT
|
60
|
+
string: '{"message":"No dispatches found with ID: nonexistent-dispatch"}'
|
61
|
+
http_version:
|
62
|
+
recorded_at: Fri, 15 Feb 2019 22:00:39 GMT
|
63
|
+
recorded_with: VCR 4.0.0
|
@@ -0,0 +1,63 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: delete
|
5
|
+
uri: https://<SCORM_ENGINE_HOST>/ScormEngineInterface/api/v1/ScormEngineGemTesting-default/dispatches/testing-dispatch-id-2/registrationCount
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- ScormEngine Ruby Gem 0.7.1
|
12
|
+
Authorization:
|
13
|
+
- Basic <BASIC_AUTH>
|
14
|
+
response:
|
15
|
+
status:
|
16
|
+
code: 204
|
17
|
+
message: ''
|
18
|
+
headers:
|
19
|
+
date:
|
20
|
+
- Fri, 15 Feb 2019 22:00:39 GMT
|
21
|
+
server:
|
22
|
+
- nginx
|
23
|
+
connection:
|
24
|
+
- Close
|
25
|
+
body:
|
26
|
+
encoding: UTF-8
|
27
|
+
string: ''
|
28
|
+
http_version:
|
29
|
+
recorded_at: Fri, 15 Feb 2019 22:00:39 GMT
|
30
|
+
- request:
|
31
|
+
method: get
|
32
|
+
uri: https://<SCORM_ENGINE_HOST>/ScormEngineInterface/api/v1/ScormEngineGemTesting-default/dispatches/testing-dispatch-id-2/registrationCount
|
33
|
+
body:
|
34
|
+
encoding: US-ASCII
|
35
|
+
string: ''
|
36
|
+
headers:
|
37
|
+
User-Agent:
|
38
|
+
- ScormEngine Ruby Gem 0.7.1
|
39
|
+
Authorization:
|
40
|
+
- Basic <BASIC_AUTH>
|
41
|
+
response:
|
42
|
+
status:
|
43
|
+
code: 200
|
44
|
+
message: ''
|
45
|
+
headers:
|
46
|
+
content-type:
|
47
|
+
- application/json
|
48
|
+
date:
|
49
|
+
- Fri, 15 Feb 2019 22:00:39 GMT
|
50
|
+
server:
|
51
|
+
- nginx
|
52
|
+
vary:
|
53
|
+
- Accept-Encoding
|
54
|
+
content-length:
|
55
|
+
- '86'
|
56
|
+
connection:
|
57
|
+
- Close
|
58
|
+
body:
|
59
|
+
encoding: ASCII-8BIT
|
60
|
+
string: '{"registrationCount":0,"lastResetTime":"2019-02-15T22:00:39.000Z"}'
|
61
|
+
http_version:
|
62
|
+
recorded_at: Fri, 15 Feb 2019 22:00:39 GMT
|
63
|
+
recorded_with: VCR 4.0.0
|
@@ -0,0 +1,63 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: delete
|
5
|
+
uri: https://<SCORM_ENGINE_HOST>/ScormEngineInterface/api/v1/ScormEngineGemTesting-default/dispatches/testing-dispatch-id-2/registrationCount
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- ScormEngine Ruby Gem 0.7.1
|
12
|
+
Authorization:
|
13
|
+
- Basic <BASIC_AUTH>
|
14
|
+
response:
|
15
|
+
status:
|
16
|
+
code: 204
|
17
|
+
message: ''
|
18
|
+
headers:
|
19
|
+
date:
|
20
|
+
- Fri, 15 Feb 2019 22:00:41 GMT
|
21
|
+
server:
|
22
|
+
- nginx
|
23
|
+
connection:
|
24
|
+
- Close
|
25
|
+
body:
|
26
|
+
encoding: UTF-8
|
27
|
+
string: ''
|
28
|
+
http_version:
|
29
|
+
recorded_at: Fri, 15 Feb 2019 22:00:41 GMT
|
30
|
+
- request:
|
31
|
+
method: get
|
32
|
+
uri: https://<SCORM_ENGINE_HOST>/ScormEngineInterface/api/v1/ScormEngineGemTesting-default/dispatches/testing-dispatch-id-2/registrationCount
|
33
|
+
body:
|
34
|
+
encoding: US-ASCII
|
35
|
+
string: ''
|
36
|
+
headers:
|
37
|
+
User-Agent:
|
38
|
+
- ScormEngine Ruby Gem 0.7.1
|
39
|
+
Authorization:
|
40
|
+
- Basic <BASIC_AUTH>
|
41
|
+
response:
|
42
|
+
status:
|
43
|
+
code: 200
|
44
|
+
message: ''
|
45
|
+
headers:
|
46
|
+
content-type:
|
47
|
+
- application/json
|
48
|
+
date:
|
49
|
+
- Fri, 15 Feb 2019 22:00:41 GMT
|
50
|
+
server:
|
51
|
+
- nginx
|
52
|
+
vary:
|
53
|
+
- Accept-Encoding
|
54
|
+
content-length:
|
55
|
+
- '86'
|
56
|
+
connection:
|
57
|
+
- Close
|
58
|
+
body:
|
59
|
+
encoding: ASCII-8BIT
|
60
|
+
string: '{"registrationCount":0,"lastResetTime":"2019-02-15T22:00:41.000Z"}'
|
61
|
+
http_version:
|
62
|
+
recorded_at: Fri, 15 Feb 2019 22:00:41 GMT
|
63
|
+
recorded_with: VCR 4.0.0
|
@@ -0,0 +1,63 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: delete
|
5
|
+
uri: https://<SCORM_ENGINE_HOST>/ScormEngineInterface/api/v1/ScormEngineGemTesting-default/dispatches/testing-dispatch-id-2/registrationCount
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- ScormEngine Ruby Gem 0.7.1
|
12
|
+
Authorization:
|
13
|
+
- Basic <BASIC_AUTH>
|
14
|
+
response:
|
15
|
+
status:
|
16
|
+
code: 204
|
17
|
+
message: ''
|
18
|
+
headers:
|
19
|
+
date:
|
20
|
+
- Fri, 15 Feb 2019 22:00:40 GMT
|
21
|
+
server:
|
22
|
+
- nginx
|
23
|
+
connection:
|
24
|
+
- Close
|
25
|
+
body:
|
26
|
+
encoding: UTF-8
|
27
|
+
string: ''
|
28
|
+
http_version:
|
29
|
+
recorded_at: Fri, 15 Feb 2019 22:00:40 GMT
|
30
|
+
- request:
|
31
|
+
method: get
|
32
|
+
uri: https://<SCORM_ENGINE_HOST>/ScormEngineInterface/api/v1/ScormEngineGemTesting-default/dispatches/testing-dispatch-id-2/registrationCount
|
33
|
+
body:
|
34
|
+
encoding: US-ASCII
|
35
|
+
string: ''
|
36
|
+
headers:
|
37
|
+
User-Agent:
|
38
|
+
- ScormEngine Ruby Gem 0.7.1
|
39
|
+
Authorization:
|
40
|
+
- Basic <BASIC_AUTH>
|
41
|
+
response:
|
42
|
+
status:
|
43
|
+
code: 200
|
44
|
+
message: ''
|
45
|
+
headers:
|
46
|
+
content-type:
|
47
|
+
- application/json
|
48
|
+
date:
|
49
|
+
- Fri, 15 Feb 2019 22:00:40 GMT
|
50
|
+
server:
|
51
|
+
- nginx
|
52
|
+
vary:
|
53
|
+
- Accept-Encoding
|
54
|
+
content-length:
|
55
|
+
- '86'
|
56
|
+
connection:
|
57
|
+
- Close
|
58
|
+
body:
|
59
|
+
encoding: ASCII-8BIT
|
60
|
+
string: '{"registrationCount":0,"lastResetTime":"2019-02-15T22:00:40.000Z"}'
|
61
|
+
http_version:
|
62
|
+
recorded_at: Fri, 15 Feb 2019 22:00:40 GMT
|
63
|
+
recorded_with: VCR 4.0.0
|
@@ -0,0 +1,51 @@
|
|
1
|
+
RSpec.describe ScormEngine::Api::Endpoints::Configuration do
|
2
|
+
describe "#get_app_configuration" do
|
3
|
+
let(:subject) { scorm_engine_client.get_app_configuration }
|
4
|
+
|
5
|
+
it "is successful" do
|
6
|
+
expect(subject.success?).to eq true
|
7
|
+
end
|
8
|
+
|
9
|
+
it "returns settings and values" do
|
10
|
+
expect(subject.result.UserCountReportLookBackDays).to be_truthy
|
11
|
+
expect(subject.result["UserCountReportDaysBetweenReports"]).to be_truthy
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
describe "#post_app_configuration" do
|
16
|
+
let(:subject) { scorm_engine_client }
|
17
|
+
let(:response) {
|
18
|
+
subject.post_app_configuration(
|
19
|
+
settings: { "UserCountReportLookBackDays" => "90",
|
20
|
+
"UserCountReportDaysBetweenReports" => 20 }
|
21
|
+
)
|
22
|
+
}
|
23
|
+
|
24
|
+
it "is successful" do
|
25
|
+
expect(response.success?).to eq true
|
26
|
+
end
|
27
|
+
|
28
|
+
it "persists the settings" do
|
29
|
+
response # trigger the api
|
30
|
+
configuration = subject.get_app_configuration.result
|
31
|
+
expect(configuration["UserCountReportLookBackDays"]).to eq "90"
|
32
|
+
expect(configuration["UserCountReportDaysBetweenReports"]).to eq "20"
|
33
|
+
|
34
|
+
subject.post_app_configuration(
|
35
|
+
settings: { "UserCountReportLookBackDays" => "365",
|
36
|
+
"UserCountReportDaysBetweenReports" => 30 }
|
37
|
+
)
|
38
|
+
|
39
|
+
configuration = subject.get_app_configuration.result
|
40
|
+
expect(configuration["UserCountReportLookBackDays"]).to eq "365"
|
41
|
+
expect(configuration["UserCountReportDaysBetweenReports"]).to eq "30"
|
42
|
+
end
|
43
|
+
|
44
|
+
it "fails when settings are invalid" do
|
45
|
+
response = subject.post_app_configuration(settings: { "NonExistentSettingTotesBogus" => "YES" })
|
46
|
+
expect(response.success?).to eq false
|
47
|
+
expect(response.status).to eq 400
|
48
|
+
expect(response.message).to match(/NonExistentSettingTotesBogus is not a valid setting ID/)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|