scorm_engine 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/lib/scorm_engine/api/endpoints/dispatches.rb +1 -0
  3. data/lib/scorm_engine/api/endpoints/registrations.rb +5 -5
  4. data/lib/scorm_engine/configuration.rb +3 -2
  5. data/lib/scorm_engine/faraday/connection.rb +1 -1
  6. data/lib/scorm_engine/models/course.rb +35 -6
  7. data/lib/scorm_engine/models/course_configuration.rb +3 -3
  8. data/lib/scorm_engine/models/course_import.rb +22 -6
  9. data/lib/scorm_engine/models/destination.rb +9 -4
  10. data/lib/scorm_engine/models/dispatch.rb +44 -5
  11. data/lib/scorm_engine/models/dispatch_zip.rb +20 -2
  12. data/lib/scorm_engine/models/learner.rb +14 -4
  13. data/lib/scorm_engine/models/registration.rb +67 -22
  14. data/lib/scorm_engine/models/registration_activity_detail.rb +21 -11
  15. data/lib/scorm_engine/models/registration_configuration.rb +3 -3
  16. data/lib/scorm_engine/models/registration_launch_history.rb +46 -13
  17. data/lib/scorm_engine/models/registration_runtime_interaction.rb +58 -11
  18. data/lib/scorm_engine/version.rb +1 -1
  19. data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatch_zip/fails_given_an_invalid_id.yml +3 -3
  20. data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatch_zip/fails_given_an_invalid_type.yml +3 -3
  21. data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatch_zip/works.yml +6 -6
  22. data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatch_zip/works_when_type_is_AICC.yml +6 -6
  23. data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatch_zip/works_when_type_is_SCORM12.yml +6 -6
  24. data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatch_zip/works_when_type_is_SCORM2004-3RD.yml +6 -6
  25. data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_delete_registration/is_failure_when_registration_does_not_exist.yml +3 -5
  26. data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_delete_registration/is_successful_when_registration_exists.yml +3 -5
  27. data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_get_registration_exists/is_false_when_registration_does_not_exist.yml +3 -5
  28. data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_get_registration_exists/is_true_when_registration_exists.yml +3 -5
  29. data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_get_registration_instances/includes_results_we_expect.yml +6 -8
  30. data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_get_registration_instances/is_successful.yml +6 -8
  31. data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_get_registration_instances/returns_an_array_of_registrations.yml +6 -8
  32. data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_get_registration_launch_link/fails_when_id_is_invalid.yml +3 -5
  33. data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_get_registration_launch_link/is_successful.yml +3 -5
  34. data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_get_registration_launch_link/results/returns_a_URL_string.yml +3 -5
  35. data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_get_registration_progress/detail/does_not_return_activity_details_by_default.yml +5 -7
  36. data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_get_registration_progress/detail/returns_activity_details_if_requested.yml +5 -7
  37. data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_get_registration_progress/fails_when_registration_does_not_exist.yml +3 -5
  38. data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_get_registration_progress/returns_a_registration_when_it_exists.yml +5 -7
  39. data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_get_registrations/filtering_by_course_id/excludes_results.yml +3 -5
  40. data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_get_registrations/filtering_by_course_id/includes_results.yml +6 -9
  41. data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_get_registrations/filtering_by_learner_id/excludes_results.yml +3 -5
  42. data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_get_registrations/filtering_by_learner_id/includes_results.yml +5 -7
  43. data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_get_registrations/includes_results_we_expect.yml +6 -9
  44. data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_get_registrations/is_successful.yml +6 -9
  45. data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_get_registrations/returns_an_array_of_registrations.yml +6 -9
  46. data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_post_registration/fails_if_course_id_is_invalid.yml +6 -6
  47. data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_post_registration/fails_if_registration_id_already_exists.yml +6 -6
  48. data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_post_registration/is_successful.yml +9 -11
  49. data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_post_registration/is_successful_even_when_given_a_UTF8/slashed_username.yml +9 -47
  50. data/spec/scorm_engine/api/endpoints/dispatches_spec.rb +1 -1
  51. data/spec/scorm_engine/api/endpoints/registrations_spec.rb +8 -1
  52. data/spec/scorm_engine/configuration_spec.rb +22 -0
  53. data/spec/scorm_engine/models/course_import_spec.rb +2 -2
  54. data/spec/scorm_engine/models/course_spec.rb +2 -2
  55. data/spec/scorm_engine/models/dispatch_zip_spec.rb +1 -1
  56. data/spec/scorm_engine/models/registration_runtime_interaction_spec.rb +7 -0
  57. data/spec/scorm_engine/models/registration_spec.rb +7 -0
  58. metadata +1 -1
@@ -7,10 +7,8 @@ http_interactions:
7
7
  encoding: US-ASCII
8
8
  string: ''
9
9
  headers:
10
- Content-Type:
11
- - application/json
12
10
  User-Agent:
13
- - ScormEngine Ruby Gem 0.1.0
11
+ - ScormEngine Ruby Gem 0.6.2
14
12
  Authorization:
15
13
  - Basic <BASIC_AUTH>
16
14
  response:
@@ -21,7 +19,7 @@ http_interactions:
21
19
  content-type:
22
20
  - application/json
23
21
  date:
24
- - Wed, 25 Jul 2018 17:31:49 GMT
22
+ - Fri, 24 Aug 2018 21:33:31 GMT
25
23
  server:
26
24
  - nginx
27
25
  vary:
@@ -34,5 +32,5 @@ http_interactions:
34
32
  encoding: ASCII-8BIT
35
33
  string: '{"registrations":[]}'
36
34
  http_version:
37
- recorded_at: Wed, 25 Jul 2018 17:31:49 GMT
35
+ recorded_at: Fri, 24 Aug 2018 21:33:31 GMT
38
36
  recorded_with: VCR 4.0.0
@@ -7,10 +7,8 @@ http_interactions:
7
7
  encoding: US-ASCII
8
8
  string: ''
9
9
  headers:
10
- Content-Type:
11
- - application/json
12
10
  User-Agent:
13
- - ScormEngine Ruby Gem 0.1.0
11
+ - ScormEngine Ruby Gem 0.6.2
14
12
  Authorization:
15
13
  - Basic <BASIC_AUTH>
16
14
  response:
@@ -21,7 +19,7 @@ http_interactions:
21
19
  content-type:
22
20
  - application/json
23
21
  date:
24
- - Wed, 25 Jul 2018 17:31:48 GMT
22
+ - Fri, 24 Aug 2018 21:33:33 GMT
25
23
  server:
26
24
  - nginx
27
25
  vary:
@@ -32,8 +30,8 @@ http_interactions:
32
30
  - Close
33
31
  body:
34
32
  encoding: ASCII-8BIT
35
- string: '{"registrations":[{"id":"testing-golf-explained-registration-1","instance":0,"updated":"2018-07-25T17:18:56.000Z","registrationCompletion":"UNKNOWN","registrationSuccess":"Unknown","totalSecondsTracked":0.0,"lastAccessDate":"2018-07-25T17:18:56.000Z","createdDate":"2018-07-25T17:18:56.000Z","course":{"id":"testing-golf-explained","version":0,"title":"Golf
36
- Explained - Run-time Basic Calls","courseLearningStandard":"SCORM_2004_3RD_EDITION","registrationCount":2,"updated":"2018-07-24T20:22:19.000Z"},"learner":{"id":"testing-golf-explained-learner-1","firstName":"Arnold","lastName":"Palmer"},"globalObjectives":[],"sharedData":[]}]}'
33
+ string: '{"registrations":[{"id":"testing-golf-explained-registration-1","instance":0,"updated":"2018-08-24T21:33:12.000Z","registrationCompletion":"UNKNOWN","registrationSuccess":"Unknown","totalSecondsTracked":0.0,"lastAccessDate":"2018-08-24T21:33:12.000Z","createdDate":"2018-08-24T21:33:12.000Z","course":{"id":"testing-golf-explained","version":0,"title":"Golf
34
+ Explained - Run-time Basic Calls","courseLearningStandard":"SCORM_2004_3RD_EDITION","registrationCount":1,"updated":"2018-08-15T23:19:49.000Z"},"learner":{"id":"testing-golf-explained-learner-1","firstName":"Arnold","lastName":"Palmer"},"globalObjectives":[],"sharedData":[]}]}'
37
35
  http_version:
38
- recorded_at: Wed, 25 Jul 2018 17:31:48 GMT
36
+ recorded_at: Fri, 24 Aug 2018 21:33:33 GMT
39
37
  recorded_with: VCR 4.0.0
@@ -7,10 +7,8 @@ http_interactions:
7
7
  encoding: US-ASCII
8
8
  string: ''
9
9
  headers:
10
- Content-Type:
11
- - application/json
12
10
  User-Agent:
13
- - ScormEngine Ruby Gem 0.1.0
11
+ - ScormEngine Ruby Gem 0.6.2
14
12
  Authorization:
15
13
  - Basic <BASIC_AUTH>
16
14
  response:
@@ -21,20 +19,19 @@ http_interactions:
21
19
  content-type:
22
20
  - application/json
23
21
  date:
24
- - Wed, 25 Jul 2018 17:26:40 GMT
22
+ - Fri, 24 Aug 2018 21:33:26 GMT
25
23
  server:
26
24
  - nginx
27
25
  vary:
28
26
  - Accept-Encoding
29
27
  content-length:
30
- - '402'
28
+ - '354'
31
29
  connection:
32
30
  - Close
33
31
  body:
34
32
  encoding: ASCII-8BIT
35
- string: '{"registrations":[{"id":"reg-1","instance":0,"updated":"2018-07-25T16:21:20.000Z","registrationCompletion":"UNKNOWN","registrationSuccess":"Unknown","totalSecondsTracked":0.0,"lastAccessDate":"2018-07-25T16:21:20.000Z","createdDate":"2018-07-25T16:21:20.000Z","course":{"id":"testing-golf-explained","version":0,"title":"Golf
36
- Explained - Run-time Basic Calls","courseLearningStandard":"SCORM_2004_3RD_EDITION","registrationCount":2,"updated":"2018-07-24T20:22:19.000Z"},"learner":{"id":"learner-1","firstName":"Philip","lastName":"Hallstrom"},"globalObjectives":[],"sharedData":[]},{"id":"testing-golf-explained-registration-1","instance":0,"updated":"2018-07-25T17:18:56.000Z","registrationCompletion":"UNKNOWN","registrationSuccess":"Unknown","totalSecondsTracked":0.0,"lastAccessDate":"2018-07-25T17:18:56.000Z","createdDate":"2018-07-25T17:18:56.000Z","course":{"id":"testing-golf-explained","version":0,"title":"Golf
37
- Explained - Run-time Basic Calls","courseLearningStandard":"SCORM_2004_3RD_EDITION","registrationCount":2,"updated":"2018-07-24T20:22:19.000Z"},"learner":{"id":"testing-golf-explained-learner-1","firstName":"Arnold","lastName":"Palmer"},"globalObjectives":[],"sharedData":[]}]}'
33
+ string: '{"registrations":[{"id":"testing-golf-explained-registration-1","instance":0,"updated":"2018-08-24T21:33:12.000Z","registrationCompletion":"UNKNOWN","registrationSuccess":"Unknown","totalSecondsTracked":0.0,"lastAccessDate":"2018-08-24T21:33:12.000Z","createdDate":"2018-08-24T21:33:12.000Z","course":{"id":"testing-golf-explained","version":0,"title":"Golf
34
+ Explained - Run-time Basic Calls","courseLearningStandard":"SCORM_2004_3RD_EDITION","registrationCount":1,"updated":"2018-08-15T23:19:49.000Z"},"learner":{"id":"testing-golf-explained-learner-1","firstName":"Arnold","lastName":"Palmer"},"globalObjectives":[],"sharedData":[]}]}'
38
35
  http_version:
39
- recorded_at: Wed, 25 Jul 2018 17:26:41 GMT
36
+ recorded_at: Fri, 24 Aug 2018 21:33:26 GMT
40
37
  recorded_with: VCR 4.0.0
@@ -7,10 +7,8 @@ http_interactions:
7
7
  encoding: US-ASCII
8
8
  string: ''
9
9
  headers:
10
- Content-Type:
11
- - application/json
12
10
  User-Agent:
13
- - ScormEngine Ruby Gem 0.1.0
11
+ - ScormEngine Ruby Gem 0.6.2
14
12
  Authorization:
15
13
  - Basic <BASIC_AUTH>
16
14
  response:
@@ -21,20 +19,19 @@ http_interactions:
21
19
  content-type:
22
20
  - application/json
23
21
  date:
24
- - Wed, 25 Jul 2018 17:19:00 GMT
22
+ - Fri, 24 Aug 2018 21:33:28 GMT
25
23
  server:
26
24
  - nginx
27
25
  vary:
28
26
  - Accept-Encoding
29
27
  content-length:
30
- - '402'
28
+ - '354'
31
29
  connection:
32
30
  - Close
33
31
  body:
34
32
  encoding: ASCII-8BIT
35
- string: '{"registrations":[{"id":"reg-1","instance":0,"updated":"2018-07-25T16:21:20.000Z","registrationCompletion":"UNKNOWN","registrationSuccess":"Unknown","totalSecondsTracked":0.0,"lastAccessDate":"2018-07-25T16:21:20.000Z","createdDate":"2018-07-25T16:21:20.000Z","course":{"id":"testing-golf-explained","version":0,"title":"Golf
36
- Explained - Run-time Basic Calls","courseLearningStandard":"SCORM_2004_3RD_EDITION","registrationCount":2,"updated":"2018-07-24T20:22:19.000Z"},"learner":{"id":"learner-1","firstName":"Philip","lastName":"Hallstrom"},"globalObjectives":[],"sharedData":[]},{"id":"testing-golf-explained-registration-1","instance":0,"updated":"2018-07-25T17:18:56.000Z","registrationCompletion":"UNKNOWN","registrationSuccess":"Unknown","totalSecondsTracked":0.0,"lastAccessDate":"2018-07-25T17:18:56.000Z","createdDate":"2018-07-25T17:18:56.000Z","course":{"id":"testing-golf-explained","version":0,"title":"Golf
37
- Explained - Run-time Basic Calls","courseLearningStandard":"SCORM_2004_3RD_EDITION","registrationCount":2,"updated":"2018-07-24T20:22:19.000Z"},"learner":{"id":"testing-golf-explained-learner-1","firstName":"Arnold","lastName":"Palmer"},"globalObjectives":[],"sharedData":[]}]}'
33
+ string: '{"registrations":[{"id":"testing-golf-explained-registration-1","instance":0,"updated":"2018-08-24T21:33:12.000Z","registrationCompletion":"UNKNOWN","registrationSuccess":"Unknown","totalSecondsTracked":0.0,"lastAccessDate":"2018-08-24T21:33:12.000Z","createdDate":"2018-08-24T21:33:12.000Z","course":{"id":"testing-golf-explained","version":0,"title":"Golf
34
+ Explained - Run-time Basic Calls","courseLearningStandard":"SCORM_2004_3RD_EDITION","registrationCount":1,"updated":"2018-08-15T23:19:49.000Z"},"learner":{"id":"testing-golf-explained-learner-1","firstName":"Arnold","lastName":"Palmer"},"globalObjectives":[],"sharedData":[]}]}'
38
35
  http_version:
39
- recorded_at: Wed, 25 Jul 2018 17:19:01 GMT
36
+ recorded_at: Fri, 24 Aug 2018 21:33:28 GMT
40
37
  recorded_with: VCR 4.0.0
@@ -7,10 +7,8 @@ http_interactions:
7
7
  encoding: US-ASCII
8
8
  string: ''
9
9
  headers:
10
- Content-Type:
11
- - application/json
12
10
  User-Agent:
13
- - ScormEngine Ruby Gem 0.1.0
11
+ - ScormEngine Ruby Gem 0.6.2
14
12
  Authorization:
15
13
  - Basic <BASIC_AUTH>
16
14
  response:
@@ -21,20 +19,19 @@ http_interactions:
21
19
  content-type:
22
20
  - application/json
23
21
  date:
24
- - Wed, 25 Jul 2018 17:23:50 GMT
22
+ - Fri, 24 Aug 2018 21:33:30 GMT
25
23
  server:
26
24
  - nginx
27
25
  vary:
28
26
  - Accept-Encoding
29
27
  content-length:
30
- - '402'
28
+ - '354'
31
29
  connection:
32
30
  - Close
33
31
  body:
34
32
  encoding: ASCII-8BIT
35
- string: '{"registrations":[{"id":"reg-1","instance":0,"updated":"2018-07-25T16:21:20.000Z","registrationCompletion":"UNKNOWN","registrationSuccess":"Unknown","totalSecondsTracked":0.0,"lastAccessDate":"2018-07-25T16:21:20.000Z","createdDate":"2018-07-25T16:21:20.000Z","course":{"id":"testing-golf-explained","version":0,"title":"Golf
36
- Explained - Run-time Basic Calls","courseLearningStandard":"SCORM_2004_3RD_EDITION","registrationCount":2,"updated":"2018-07-24T20:22:19.000Z"},"learner":{"id":"learner-1","firstName":"Philip","lastName":"Hallstrom"},"globalObjectives":[],"sharedData":[]},{"id":"testing-golf-explained-registration-1","instance":0,"updated":"2018-07-25T17:18:56.000Z","registrationCompletion":"UNKNOWN","registrationSuccess":"Unknown","totalSecondsTracked":0.0,"lastAccessDate":"2018-07-25T17:18:56.000Z","createdDate":"2018-07-25T17:18:56.000Z","course":{"id":"testing-golf-explained","version":0,"title":"Golf
37
- Explained - Run-time Basic Calls","courseLearningStandard":"SCORM_2004_3RD_EDITION","registrationCount":2,"updated":"2018-07-24T20:22:19.000Z"},"learner":{"id":"testing-golf-explained-learner-1","firstName":"Arnold","lastName":"Palmer"},"globalObjectives":[],"sharedData":[]}]}'
33
+ string: '{"registrations":[{"id":"testing-golf-explained-registration-1","instance":0,"updated":"2018-08-24T21:33:12.000Z","registrationCompletion":"UNKNOWN","registrationSuccess":"Unknown","totalSecondsTracked":0.0,"lastAccessDate":"2018-08-24T21:33:12.000Z","createdDate":"2018-08-24T21:33:12.000Z","course":{"id":"testing-golf-explained","version":0,"title":"Golf
34
+ Explained - Run-time Basic Calls","courseLearningStandard":"SCORM_2004_3RD_EDITION","registrationCount":1,"updated":"2018-08-15T23:19:49.000Z"},"learner":{"id":"testing-golf-explained-learner-1","firstName":"Arnold","lastName":"Palmer"},"globalObjectives":[],"sharedData":[]}]}'
38
35
  http_version:
39
- recorded_at: Wed, 25 Jul 2018 17:23:50 GMT
36
+ recorded_at: Fri, 24 Aug 2018 21:33:30 GMT
40
37
  recorded_with: VCR 4.0.0
@@ -5,14 +5,14 @@ http_interactions:
5
5
  uri: https://<SCORM_ENGINE_HOST>/ScormEngineInterface/api/v1/ScormEngineGemTesting-default/registrations
6
6
  body:
7
7
  encoding: UTF-8
8
- string: '{"courseId":"invalid-bogus","registrationId":"testing-golf-explained-registration-1","learner":{"id":"testing-golf-explained-learner-1","firstName":"Arnold","lastName":"Palmer"}}'
8
+ string: '{"courseId":"invalid-bogus","registrationId":"testing-golf-explained-registration-1","learner":{"id":"testing-golf-explained-learner-1","firstName":"Arnold","lastName":"Palmer"},"postBack":{"url":"http://playtronics.com/passback/","authType":"FORM","userName":"werner_brandes","password":"passport","resultsFormat":"ACTIVITY"}}'
9
9
  headers:
10
- Content-Type:
11
- - application/json
12
10
  User-Agent:
13
- - ScormEngine Ruby Gem 0.1.0
11
+ - ScormEngine Ruby Gem 0.6.2
14
12
  Authorization:
15
13
  - Basic <BASIC_AUTH>
14
+ Content-Type:
15
+ - application/json
16
16
  response:
17
17
  status:
18
18
  code: 400
@@ -21,7 +21,7 @@ http_interactions:
21
21
  content-type:
22
22
  - application/json
23
23
  date:
24
- - Wed, 25 Jul 2018 17:18:57 GMT
24
+ - Fri, 24 Aug 2018 21:33:08 GMT
25
25
  server:
26
26
  - nginx
27
27
  content-length:
@@ -32,5 +32,5 @@ http_interactions:
32
32
  encoding: UTF-8
33
33
  string: '{"message":"External Package ID ''invalid-bogus''"}'
34
34
  http_version:
35
- recorded_at: Wed, 25 Jul 2018 17:18:57 GMT
35
+ recorded_at: Fri, 24 Aug 2018 21:33:08 GMT
36
36
  recorded_with: VCR 4.0.0
@@ -5,14 +5,14 @@ http_interactions:
5
5
  uri: https://<SCORM_ENGINE_HOST>/ScormEngineInterface/api/v1/ScormEngineGemTesting-default/registrations
6
6
  body:
7
7
  encoding: UTF-8
8
- string: '{"courseId":"testing-golf-explained","registrationId":"testing-golf-explained-registration-1","learner":{"id":"testing-golf-explained-learner-1","firstName":"Arnold","lastName":"Palmer"}}'
8
+ string: '{"courseId":"testing-golf-explained","registrationId":"testing-golf-explained-registration-1","learner":{"id":"testing-golf-explained-learner-1","firstName":"Arnold","lastName":"Palmer"},"postBack":{"url":"http://playtronics.com/passback/","authType":"FORM","userName":"werner_brandes","password":"passport","resultsFormat":"ACTIVITY"}}'
9
9
  headers:
10
- Content-Type:
11
- - application/json
12
10
  User-Agent:
13
- - ScormEngine Ruby Gem 0.1.0
11
+ - ScormEngine Ruby Gem 0.6.2
14
12
  Authorization:
15
13
  - Basic <BASIC_AUTH>
14
+ Content-Type:
15
+ - application/json
16
16
  response:
17
17
  status:
18
18
  code: 400
@@ -21,7 +21,7 @@ http_interactions:
21
21
  content-type:
22
22
  - application/json
23
23
  date:
24
- - Wed, 25 Jul 2018 17:18:59 GMT
24
+ - Fri, 24 Aug 2018 21:33:10 GMT
25
25
  server:
26
26
  - nginx
27
27
  content-length:
@@ -32,5 +32,5 @@ http_interactions:
32
32
  encoding: UTF-8
33
33
  string: '{"message":"This RegistrationId is already in use."}'
34
34
  http_version:
35
- recorded_at: Wed, 25 Jul 2018 17:18:59 GMT
35
+ recorded_at: Fri, 24 Aug 2018 21:33:10 GMT
36
36
  recorded_with: VCR 4.0.0
@@ -7,10 +7,8 @@ http_interactions:
7
7
  encoding: US-ASCII
8
8
  string: ''
9
9
  headers:
10
- Content-Type:
11
- - application/json
12
10
  User-Agent:
13
- - ScormEngine Ruby Gem 0.1.0
11
+ - ScormEngine Ruby Gem 0.6.2
14
12
  Authorization:
15
13
  - Basic <BASIC_AUTH>
16
14
  response:
@@ -19,7 +17,7 @@ http_interactions:
19
17
  message: ''
20
18
  headers:
21
19
  date:
22
- - Wed, 25 Jul 2018 17:18:55 GMT
20
+ - Fri, 24 Aug 2018 21:33:11 GMT
23
21
  server:
24
22
  - nginx
25
23
  connection:
@@ -28,27 +26,27 @@ http_interactions:
28
26
  encoding: UTF-8
29
27
  string: ''
30
28
  http_version:
31
- recorded_at: Wed, 25 Jul 2018 17:18:55 GMT
29
+ recorded_at: Fri, 24 Aug 2018 21:33:11 GMT
32
30
  - request:
33
31
  method: post
34
32
  uri: https://<SCORM_ENGINE_HOST>/ScormEngineInterface/api/v1/ScormEngineGemTesting-default/registrations
35
33
  body:
36
34
  encoding: UTF-8
37
- string: '{"courseId":"testing-golf-explained","registrationId":"testing-golf-explained-registration-1","learner":{"id":"testing-golf-explained-learner-1","firstName":"Arnold","lastName":"Palmer"}}'
35
+ string: '{"courseId":"testing-golf-explained","registrationId":"testing-golf-explained-registration-1","learner":{"id":"testing-golf-explained-learner-1","firstName":"Arnold","lastName":"Palmer"},"postBack":{"url":"http://playtronics.com/passback/","authType":"FORM","userName":"werner_brandes","password":"passport","resultsFormat":"ACTIVITY"}}'
38
36
  headers:
39
- Content-Type:
40
- - application/json
41
37
  User-Agent:
42
- - ScormEngine Ruby Gem 0.1.0
38
+ - ScormEngine Ruby Gem 0.6.2
43
39
  Authorization:
44
40
  - Basic <BASIC_AUTH>
41
+ Content-Type:
42
+ - application/json
45
43
  response:
46
44
  status:
47
45
  code: 204
48
46
  message: ''
49
47
  headers:
50
48
  date:
51
- - Wed, 25 Jul 2018 17:18:56 GMT
49
+ - Fri, 24 Aug 2018 21:33:12 GMT
52
50
  server:
53
51
  - nginx
54
52
  connection:
@@ -57,5 +55,5 @@ http_interactions:
57
55
  encoding: UTF-8
58
56
  string: ''
59
57
  http_version:
60
- recorded_at: Wed, 25 Jul 2018 17:18:56 GMT
58
+ recorded_at: Fri, 24 Aug 2018 21:33:12 GMT
61
59
  recorded_with: VCR 4.0.0
@@ -7,10 +7,8 @@ http_interactions:
7
7
  encoding: US-ASCII
8
8
  string: ''
9
9
  headers:
10
- Content-Type:
11
- - application/json
12
10
  User-Agent:
13
- - ScormEngine Ruby Gem 0.3.0
11
+ - ScormEngine Ruby Gem 0.6.2
14
12
  Authorization:
15
13
  - Basic <BASIC_AUTH>
16
14
  response:
@@ -19,7 +17,7 @@ http_interactions:
19
17
  message: ''
20
18
  headers:
21
19
  date:
22
- - Fri, 17 Aug 2018 21:40:15 GMT
20
+ - Fri, 24 Aug 2018 21:33:05 GMT
23
21
  server:
24
22
  - nginx
25
23
  connection:
@@ -28,27 +26,27 @@ http_interactions:
28
26
  encoding: UTF-8
29
27
  string: ''
30
28
  http_version:
31
- recorded_at: Fri, 17 Aug 2018 21:40:15 GMT
29
+ recorded_at: Fri, 24 Aug 2018 21:33:05 GMT
32
30
  - request:
33
31
  method: post
34
32
  uri: https://<SCORM_ENGINE_HOST>/ScormEngineInterface/api/v1/ScormEngineGemTesting-default/registrations
35
33
  body:
36
34
  encoding: UTF-8
37
- string: '{"courseId":"testing-golf-explained","registrationId":"testing-golf-explained-registration-1","learner":{"id":"testing-golf-explained-learner-1","firstName":"Släshy","lastName":"Mc/SláshFacę"}}'
35
+ string: '{"courseId":"testing-golf-explained","registrationId":"testing-golf-explained-registration-1","learner":{"id":"testing-golf-explained-learner-1","firstName":"Släshy","lastName":"Mč/SláshFacę"},"postBack":{"url":"http://playtronics.com/passback/","authType":"FORM","userName":"werner_brandes","password":"passport","resultsFormat":"ACTIVITY"}}'
38
36
  headers:
39
- Content-Type:
40
- - application/json
41
37
  User-Agent:
42
- - ScormEngine Ruby Gem 0.3.0
38
+ - ScormEngine Ruby Gem 0.6.2
43
39
  Authorization:
44
40
  - Basic <BASIC_AUTH>
41
+ Content-Type:
42
+ - application/json
45
43
  response:
46
44
  status:
47
45
  code: 204
48
46
  message: ''
49
47
  headers:
50
48
  date:
51
- - Fri, 17 Aug 2018 21:40:15 GMT
49
+ - Fri, 24 Aug 2018 21:33:06 GMT
52
50
  server:
53
51
  - nginx
54
52
  connection:
@@ -57,41 +55,5 @@ http_interactions:
57
55
  encoding: UTF-8
58
56
  string: ''
59
57
  http_version:
60
- recorded_at: Fri, 17 Aug 2018 21:40:15 GMT
61
- - request:
62
- method: get
63
- uri: https://<SCORM_ENGINE_HOST>/ScormEngineInterface/api/v1/ScormEngineGemTesting-default/registrations?learnerId=testing-golf-explained-learner-1
64
- body:
65
- encoding: US-ASCII
66
- string: ''
67
- headers:
68
- Content-Type:
69
- - application/json
70
- User-Agent:
71
- - ScormEngine Ruby Gem 0.3.0
72
- Authorization:
73
- - Basic <BASIC_AUTH>
74
- response:
75
- status:
76
- code: 200
77
- message: ''
78
- headers:
79
- content-type:
80
- - application/json
81
- date:
82
- - Fri, 17 Aug 2018 21:40:16 GMT
83
- server:
84
- - nginx
85
- vary:
86
- - Accept-Encoding
87
- content-length:
88
- - '369'
89
- connection:
90
- - Close
91
- body:
92
- encoding: ASCII-8BIT
93
- string: !binary |-
94
- eyJyZWdpc3RyYXRpb25zIjpbeyJpZCI6InRlc3RpbmctZ29sZi1leHBsYWluZWQtcmVnaXN0cmF0aW9uLTEiLCJpbnN0YW5jZSI6MCwidXBkYXRlZCI6IjIwMTgtMDgtMTdUMjE6NDA6MTYuMDAwWiIsInJlZ2lzdHJhdGlvbkNvbXBsZXRpb24iOiJVTktOT1dOIiwicmVnaXN0cmF0aW9uU3VjY2VzcyI6IlVua25vd24iLCJ0b3RhbFNlY29uZHNUcmFja2VkIjowLjAsImxhc3RBY2Nlc3NEYXRlIjoiMjAxOC0wOC0xN1QyMTo0MDoxNi4wMDBaIiwiY3JlYXRlZERhdGUiOiIyMDE4LTA4LTE3VDIxOjQwOjE2LjAwMFoiLCJjb3Vyc2UiOnsiaWQiOiJ0ZXN0aW5nLWdvbGYtZXhwbGFpbmVkIiwidmVyc2lvbiI6MCwidGl0bGUiOiJHb2xmIEV4cGxhaW5lZCAtIFJ1bi10aW1lIEJhc2ljIENhbGxzIiwiY291cnNlTGVhcm5pbmdTdGFuZGFyZCI6IlNDT1JNXzIwMDRfM1JEX0VESVRJT04iLCJyZWdpc3RyYXRpb25Db3VudCI6MSwidXBkYXRlZCI6IjIwMTgtMDgtMTVUMjM6MTk6NDkuMDAwWiJ9LCJsZWFybmVyIjp7ImlkIjoidGVzdGluZy1nb2xmLWV4cGxhaW5lZC1sZWFybmVyLTEiLCJmaXJzdE5hbWUiOiJTbMOkc2h5IiwibGFzdE5hbWUiOiJNYy9TbMOhc2hGYWPEmSJ9LCJnbG9iYWxPYmplY3RpdmVzIjpbXSwic2hhcmVkRGF0YSI6W119XX0=
95
- http_version:
96
- recorded_at: Fri, 17 Aug 2018 21:40:16 GMT
58
+ recorded_at: Fri, 24 Aug 2018 21:33:06 GMT
97
59
  recorded_with: VCR 4.0.0
@@ -230,7 +230,7 @@ RSpec.describe ScormEngine::Api::Endpoints::Dispatches do
230
230
  end
231
231
 
232
232
  it "works when type is SCORM12" do
233
- response = subject.get_dispatch_zip(dispatch_id: dispatch_options[:dispatch_id], type: "SCORM12")
233
+ response = subject.get_dispatch_zip(dispatch_id: dispatch_options[:dispatch_id], type: "scorm12")
234
234
  aggregate_failures do
235
235
  expect(response.success?).to eq true
236
236
  expect(response.result.type).to eq "SCORM12"
@@ -8,7 +8,14 @@ RSpec.describe ScormEngine::Api::Endpoints::Registrations do
8
8
  id: "testing-golf-explained-learner-1",
9
9
  first_name: "Arnold",
10
10
  last_name: "Palmer",
11
- }
11
+ },
12
+ post_back: {
13
+ url: "http://playtronics.com/passback/",
14
+ auth_type: "form",
15
+ user_name: "werner_brandes",
16
+ password: "passport",
17
+ results_format: "activity",
18
+ },
12
19
  } }
13
20
 
14
21
  before do
@@ -26,4 +26,26 @@ RSpec.describe ScormEngine::Configuration do
26
26
  it "knows its log options" do
27
27
  expect(ScormEngine.configuration.log_options).to eq({ headers: false, bodies: false })
28
28
  end
29
+
30
+ describe "path_prefix" do
31
+ it "knows the default" do
32
+ expect(ScormEngine.configuration.path_prefix).to eq "/ScormEngineInterface/api/v1/"
33
+ end
34
+
35
+ it "can be overridden" do
36
+ ScormEngine.configure { |c| c.path_prefix = "/foo/bar/" }
37
+ expect(ScormEngine.configuration.path_prefix).to eq "/foo/bar/"
38
+ end
39
+ end
40
+
41
+ describe "protocol" do
42
+ it "knows the default" do
43
+ expect(ScormEngine.configuration.protocol).to eq "https"
44
+ end
45
+
46
+ it "can be overridden" do
47
+ ScormEngine.configure { |c| c.protocol = "http" }
48
+ expect(ScormEngine.configuration.protocol).to eq "http"
49
+ end
50
+ end
29
51
  end