scorm_engine 0.7.2 → 0.8.3
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 +94 -0
- data/lib/scorm_engine/api/endpoints/courses/configuration.rb +1 -1
- 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 +19 -4
- data/lib/scorm_engine/models.rb +1 -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_About/_get_about/is_successful.yml +24 -15
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_About/_get_about/knows_the_platform.yml +24 -15
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_About/_get_about/knows_the_version.yml +24 -15
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_About/_get_about_user_count/accepts_before_option.yml +23 -15
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_About/_get_about_user_count/accepts_since_option.yml +23 -15
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_About/_get_about_user_count/is_successful.yml +23 -15
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_About/_get_about_user_count/tracks_combined_counts.yml +23 -15
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_About/_get_about_user_count/tracks_per_tenantcounts.yml +23 -15
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Configuration/_delete_app_configuration/fails_when_settings_are_invalid.yml +46 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Configuration/_delete_app_configuration/is_successful.yml +42 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Configuration/_get_app_configuration/includeMetadata/is_successful.yml +931 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Configuration/_get_app_configuration/includeMetadata/returns_metadata_in_raw_response_when_included_in_options.yml +931 -0
- 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/_delete_course/fails_when_id_is_invalid.yml +23 -15
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses/_delete_course/works.yml +19 -9
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses/_get_course_detail/fails_when_id_is_invalid.yml +23 -15
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses/_get_course_detail/is_successful.yml +24 -16
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses/_get_course_detail/results/sucessfully_creates_the_Course_attributes.yml +24 -16
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses/_get_course_preview/fails_when_id_is_invalid.yml +23 -15
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses/_get_course_preview/is_successful.yml +23 -15
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses/_get_course_preview/results/returns_a_URL_string.yml +23 -15
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses/_get_courses/_course_id_option/fetches_a_single_course_but_perhaps_multiple_versions.yml +23 -15
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses/_get_courses/_course_id_option/returns_404_when_ID_is_invalid.yml +23 -15
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses/_get_courses/_more_option_pagination_/returns_all_the_courses.yml +65 -45
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses/_get_courses/_more_option_pagination_/returns_the_more_key_in_the_raw_response.yml +32 -24
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses/_get_courses/_since_option/fails_when_passed_an_invalid_value.yml +20 -10
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses/_get_courses/_since_option/works.yml +42 -19
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses/_get_courses/is_successful.yml +32 -19
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses/_get_courses/results/is_an_enumerator_of_Course_models.yml +32 -19
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses/_get_courses/results/sucessfully_creates_the_Course_attributes.yml +32 -19
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses_Configuration/_get_course_configuration/fails_when_id_is_invalid.yml +23 -15
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses_Configuration/_get_course_configuration/is_successful.yml +23 -15
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses_Configuration/_get_course_configuration/results/makes_settings_available_as_key/value_pairs.yml +23 -15
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses_Configuration/_get_course_configuration_setting/fails_when_course_id_is_invalid.yml +23 -15
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses_Configuration/_get_course_configuration_setting/fails_when_setting_id_is_invalid.yml +20 -10
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses_Configuration/_get_course_configuration_setting/is_successful.yml +41 -19
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses_Configuration/_get_course_configuration_setting/results/returns_the_value_as_a_string.yml +41 -19
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses_Configuration/_post_course_configuration/fails_when_id_is_invalid.yml +25 -15
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses_Configuration/_post_course_configuration/fails_when_settings_are_invalid.yml +24 -12
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses_Configuration/_post_course_configuration/is_successful.yml +21 -9
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses_Configuration/_post_course_configuration/persists_the_settings.yml +88 -48
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses_Configuration/_put_course_configuration_setting/fails_when_course_id_is_invalid.yml +25 -15
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses_Configuration/_put_course_configuration_setting/fails_when_setting_id_is_invalid.yml +20 -10
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses_Configuration/_put_course_configuration_setting/is_successful.yml +41 -19
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses_Configuration/_put_course_configuration_setting/results/persists_the_changes.yml +61 -29
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses_Import/_get_course_import/successful_imports/works.yml +102 -95
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses_Import/_get_course_import/unsuccessful_imports/fails_to_import_given_an_invalid_url.yml +73 -294
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses_Import/_post_course_import/unsuccessful_imports/fails_to_import_a_previously_existing_course.yml +21 -9
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_delete_destination/returns_success_even_when_id_is_invalid.yml +19 -9
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_delete_destination/works.yml +19 -9
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_get_destination/fails_when_id_is_invalid.yml +22 -14
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_get_destination/is_successful.yml +22 -14
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_get_destination/results/sucessfully_creates_the_destination_attributes.yml +22 -14
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_get_destination_dispatches_registration_count/fails_when_invalid.yml +22 -14
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_get_destination_dispatches_registration_count/works.yml +20 -10
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_get_destinations/_more_option_pagination_/returns_all_the_destinations.yml +48 -31
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_get_destinations/_more_option_pagination_/returns_the_more_key_in_the_raw_response.yml +23 -15
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_get_destinations/_since_option/fails_when_passed_an_invalid_value.yml +22 -13
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_get_destinations/_since_option/works.yml +24 -15
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_get_destinations/is_successful.yml +23 -15
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_get_destinations/results/is_an_enumerator_of_Destination_models.yml +23 -15
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_get_destinations/results/sucessfully_creates_the_Destination_attributes.yml +65 -13
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_post_destination/is_successful.yml +40 -18
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_post_destination/is_successful_even_if_the_destination_id_is_not_unique.yml +21 -9
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_post_destination_dispatches_enabled/fails_when_invalid.yml +24 -12
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_post_destination_dispatches_enabled/works_when_false.yml +21 -9
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_post_destination_dispatches_enabled/works_when_true.yml +21 -9
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_post_destination_dispatches_registration_instancing/fails_when_invalid.yml +24 -12
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_post_destination_dispatches_registration_instancing/works_when_false.yml +21 -9
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_post_destination_dispatches_registration_instancing/works_when_true.yml +21 -9
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_put_destination/is_successful.yml +21 -9
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_put_destination/results/sucessfully_creates_the_destination_attributes.yml +43 -23
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_delete_dispatch/returns_success_even_when_id_is_invalid.yml +19 -7
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_delete_dispatch/works.yml +19 -7
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_delete_dispatch_registration_count/is_successful.yml +19 -7
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_delete_dispatch_registration_count/succeeds_even_when_id_is_invalid.yml +19 -7
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatch/fails_when_id_is_invalid.yml +22 -12
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatch/is_successful.yml +23 -13
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatch/results/sucessfully_creates_the_dispatch_attributes.yml +23 -13
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatch_enabled/is_false_when_disabled.yml +39 -15
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatch_enabled/is_true_when_enabled.yml +39 -15
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatch_registration_count/fails_when_id_is_invalid.yml +41 -19
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatch_registration_count/is_successful.yml +42 -20
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatch_registration_count/results/sucessfully_creates_the_dispatch_attributes.yml +42 -20
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatch_zip/fails_given_an_invalid_id.yml +22 -12
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatch_zip/fails_given_an_invalid_type.yml +20 -8
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatch_zip/works.yml +24 -12
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatch_zip/works_when_type_is_AICC.yml +24 -12
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatch_zip/works_when_type_is_SCORM12.yml +24 -12
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatch_zip/works_when_type_is_SCORM2004-3RD.yml +23 -11
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatches/_more_option_pagination_/returns_all_the_dispatches.yml +47 -27
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatches/_more_option_pagination_/returns_the_more_key_in_the_raw_response.yml +23 -13
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatches/_since_option/fails_when_passed_an_invalid_value.yml +20 -8
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatches/_since_option/works.yml +23 -13
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatches/is_successful.yml +23 -13
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatches/results/is_an_enumerator_of_dispatch_models.yml +23 -13
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatches/results/sucessfully_creates_the_dispatch_attributes.yml +21 -44
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_post_dispatch/is_successful.yml +38 -14
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_post_dispatch/updates_if_same_dispatch_id.yml +65 -33
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_put_dispatch/is_successful.yml +19 -7
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_put_dispatch/results/sucessfully_creates_the_dispatch_attributes.yml +42 -20
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_put_dispatch_enabled/fails_when_invalid.yml +22 -10
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_put_dispatch_enabled/works_when_false.yml +19 -7
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_put_dispatch_enabled/works_when_true.yml +19 -7
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Ping/_get_ping/is_successful.yml +23 -15
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Ping/_get_ping/reports_the_api_is_up.yml +23 -15
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Ping/_get_ping/with_invalid_password/is_unsuccessful.yml +25 -17
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Ping/_get_ping/with_invalid_password/returns_status_403.yml +25 -17
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_delete_registration/is_failure_when_registration_does_not_exist.yml +23 -13
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_delete_registration/is_successful_when_registration_exists.yml +19 -7
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_get_registration_exists/is_false_when_registration_does_not_exist.yml +23 -13
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_get_registration_exists/is_true_when_registration_exists.yml +20 -8
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_get_registration_instances/includes_results_we_expect.yml +26 -14
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_get_registration_instances/is_successful.yml +26 -14
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_get_registration_instances/returns_an_array_of_registrations.yml +26 -14
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_get_registration_launch_link/fails_when_id_is_invalid.yml +23 -13
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_get_registration_launch_link/is_successful.yml +23 -13
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_get_registration_launch_link/results/returns_a_URL_string.yml +23 -13
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_get_registration_progress/detail/does_not_return_activity_details_by_default.yml +24 -14
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_get_registration_progress/detail/returns_activity_details_if_requested.yml +24 -14
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_get_registration_progress/fails_when_registration_does_not_exist.yml +23 -13
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_get_registration_progress/returns_a_registration_when_it_exists.yml +24 -14
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_get_registrations/filtering_by_course_id/excludes_results.yml +22 -12
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_get_registrations/filtering_by_course_id/includes_results.yml +26 -14
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_get_registrations/filtering_by_learner_id/excludes_results.yml +22 -12
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_get_registrations/filtering_by_learner_id/includes_results.yml +26 -14
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_get_registrations/includes_results_we_expect.yml +26 -14
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_get_registrations/is_successful.yml +26 -14
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_get_registrations/returns_an_array_of_registrations.yml +26 -14
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_post_registration/fails_if_course_id_is_invalid.yml +22 -10
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_post_registration/fails_if_registration_id_already_exists.yml +20 -8
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_post_registration/is_successful.yml +38 -14
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_post_registration/is_successful_even_when_given_a_UTF8/slashed_username.yml +38 -14
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations_Configuration/_get_registration_configuration/fails_when_id_is_invalid.yml +23 -15
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations_Configuration/_get_registration_configuration/is_successful.yml +23 -15
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations_Configuration/_get_registration_configuration/results/makes_settings_available_as_key/value_pairs.yml +23 -15
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations_Configuration/_get_registration_configuration_setting/fails_when_registration_id_is_invalid.yml +23 -15
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations_Configuration/_get_registration_configuration_setting/fails_when_setting_id_is_invalid.yml +20 -10
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations_Configuration/_get_registration_configuration_setting/is_successful.yml +41 -19
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations_Configuration/_get_registration_configuration_setting/results/returns_the_value_as_a_string.yml +41 -19
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations_Configuration/_post_registration_configuration/fails_when_id_is_invalid.yml +25 -15
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations_Configuration/_post_registration_configuration/fails_when_settings_are_invalid.yml +24 -12
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations_Configuration/_post_registration_configuration/is_successful.yml +21 -9
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations_Configuration/_post_registration_configuration/persists_the_settings.yml +88 -48
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations_Configuration/_put_registration_configuration_setting/fails_when_registration_id_is_invalid.yml +25 -15
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations_Configuration/_put_registration_configuration_setting/fails_when_setting_id_is_invalid.yml +20 -10
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations_Configuration/_put_registration_configuration_setting/is_successful.yml +41 -19
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations_Configuration/_put_registration_configuration_setting/results/persists_the_changes.yml +61 -29
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations_LaunchHistory/_get_registration_launch_history/fails_when_registration_does_not_exist.yml +23 -15
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations_LaunchHistory/_get_registration_launch_history/is_successful.yml +23 -31
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations_LaunchHistory/_get_registration_launch_history/returns_an_array_of_registration_launch_histories.yml +23 -31
- data/spec/scorm_engine/api/endpoints/about_spec.rb +1 -1
- data/spec/scorm_engine/api/endpoints/configuration_spec.rb +82 -0
- data/spec/scorm_engine/api/endpoints/courses/configuration_spec.rb +5 -5
- data/spec/scorm_engine/api/endpoints/courses_spec.rb +6 -6
- data/spec/scorm_engine/api/endpoints/destinations_spec.rb +2 -2
- data/spec/scorm_engine/api/endpoints/dispatches_spec.rb +1 -1
- data/spec/scorm_engine/api/endpoints/registrations/configuration_spec.rb +5 -5
- data/spec/scorm_engine/api/endpoints/registrations_spec.rb +2 -2
- 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/tenant_configuration_spec.rb +16 -0
- data/spec/support/vcr.rb +1 -0
- metadata +28 -13
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_delete_destination/raises_ArgumentError_when_destination_id_is_missing.yml +0 -32
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatch_registration_count/when_dispatch_has_registrations/knows_it_s_registration_count.yml +0 -63
@@ -7,32 +7,42 @@ 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.
|
11
|
+
- ScormEngine Ruby Gem 0.8.2
|
14
12
|
Authorization:
|
15
13
|
- Basic <BASIC_AUTH>
|
16
14
|
response:
|
17
15
|
status:
|
18
16
|
code: 200
|
19
|
-
message:
|
17
|
+
message: OK
|
20
18
|
headers:
|
21
19
|
content-type:
|
22
20
|
- application/json
|
23
|
-
date:
|
24
|
-
- Wed, 25 Jul 2018 22:10:12 GMT
|
25
|
-
server:
|
26
|
-
- nginx
|
27
21
|
content-length:
|
28
22
|
- '14'
|
29
23
|
connection:
|
30
|
-
-
|
24
|
+
- close
|
25
|
+
date:
|
26
|
+
- Tue, 10 Nov 2020 22:58:37 GMT
|
27
|
+
p3p:
|
28
|
+
- CP="NOI"
|
29
|
+
server:
|
30
|
+
- Apache
|
31
|
+
x-xss-protection:
|
32
|
+
- 1; mode=block
|
33
|
+
x-cache:
|
34
|
+
- Miss from cloudfront
|
35
|
+
via:
|
36
|
+
- 1.1 8c71f944838e56d18361877af4839d5f.cloudfront.net (CloudFront)
|
37
|
+
x-amz-cf-pop:
|
38
|
+
- SLC50-C1
|
39
|
+
x-amz-cf-id:
|
40
|
+
- r40MEfXi2Ky5WM-Ug9lViGm6tTms7LiPS07vDqoeaRl4G0PvD0rSzg==
|
31
41
|
body:
|
32
42
|
encoding: UTF-8
|
33
43
|
string: '{"value":"81"}'
|
34
44
|
http_version:
|
35
|
-
recorded_at:
|
45
|
+
recorded_at: Tue, 10 Nov 2020 22:58:37 GMT
|
36
46
|
- request:
|
37
47
|
method: put
|
38
48
|
uri: https://<SCORM_ENGINE_HOST>/ScormEngineInterface/api/v1/ScormEngineGemTesting-default/registrations/testing-golf-explained-registration-1/configuration/PlayerStatusRollupModeThresholdScore
|
@@ -40,28 +50,40 @@ http_interactions:
|
|
40
50
|
encoding: UTF-8
|
41
51
|
string: '{"value":"82"}'
|
42
52
|
headers:
|
43
|
-
Content-Type:
|
44
|
-
- application/json
|
45
53
|
User-Agent:
|
46
|
-
- ScormEngine Ruby Gem 0.
|
54
|
+
- ScormEngine Ruby Gem 0.8.2
|
47
55
|
Authorization:
|
48
56
|
- Basic <BASIC_AUTH>
|
57
|
+
Content-Type:
|
58
|
+
- application/json
|
49
59
|
response:
|
50
60
|
status:
|
51
61
|
code: 204
|
52
|
-
message:
|
62
|
+
message: No Content
|
53
63
|
headers:
|
64
|
+
connection:
|
65
|
+
- close
|
54
66
|
date:
|
55
|
-
-
|
67
|
+
- Tue, 10 Nov 2020 22:58:37 GMT
|
68
|
+
p3p:
|
69
|
+
- CP="NOI"
|
56
70
|
server:
|
57
|
-
-
|
58
|
-
|
59
|
-
-
|
71
|
+
- Apache
|
72
|
+
x-xss-protection:
|
73
|
+
- 1; mode=block
|
74
|
+
x-cache:
|
75
|
+
- Miss from cloudfront
|
76
|
+
via:
|
77
|
+
- 1.1 784c61a450d9d48ba54eb73f4a51e6db.cloudfront.net (CloudFront)
|
78
|
+
x-amz-cf-pop:
|
79
|
+
- SLC50-C1
|
80
|
+
x-amz-cf-id:
|
81
|
+
- lzKWSYxDo1mdzTJ9cEwCWNYsn3G5LyncyeFu5ypNWRiI1Nr1ImOkqQ==
|
60
82
|
body:
|
61
83
|
encoding: UTF-8
|
62
84
|
string: ''
|
63
85
|
http_version:
|
64
|
-
recorded_at:
|
86
|
+
recorded_at: Tue, 10 Nov 2020 22:58:37 GMT
|
65
87
|
- request:
|
66
88
|
method: get
|
67
89
|
uri: https://<SCORM_ENGINE_HOST>/ScormEngineInterface/api/v1/ScormEngineGemTesting-default/registrations/testing-golf-explained-registration-1/configuration/PlayerStatusRollupModeThresholdScore
|
@@ -69,30 +91,40 @@ http_interactions:
|
|
69
91
|
encoding: US-ASCII
|
70
92
|
string: ''
|
71
93
|
headers:
|
72
|
-
Content-Type:
|
73
|
-
- application/json
|
74
94
|
User-Agent:
|
75
|
-
- ScormEngine Ruby Gem 0.
|
95
|
+
- ScormEngine Ruby Gem 0.8.2
|
76
96
|
Authorization:
|
77
97
|
- Basic <BASIC_AUTH>
|
78
98
|
response:
|
79
99
|
status:
|
80
100
|
code: 200
|
81
|
-
message:
|
101
|
+
message: OK
|
82
102
|
headers:
|
83
103
|
content-type:
|
84
104
|
- application/json
|
85
|
-
date:
|
86
|
-
- Wed, 25 Jul 2018 22:10:13 GMT
|
87
|
-
server:
|
88
|
-
- nginx
|
89
105
|
content-length:
|
90
106
|
- '14'
|
91
107
|
connection:
|
92
|
-
-
|
108
|
+
- close
|
109
|
+
date:
|
110
|
+
- Tue, 10 Nov 2020 22:58:37 GMT
|
111
|
+
p3p:
|
112
|
+
- CP="NOI"
|
113
|
+
server:
|
114
|
+
- Apache
|
115
|
+
x-xss-protection:
|
116
|
+
- 1; mode=block
|
117
|
+
x-cache:
|
118
|
+
- Miss from cloudfront
|
119
|
+
via:
|
120
|
+
- 1.1 42388efa0b39dd5e33d371d553418dbf.cloudfront.net (CloudFront)
|
121
|
+
x-amz-cf-pop:
|
122
|
+
- SLC50-C1
|
123
|
+
x-amz-cf-id:
|
124
|
+
- m_aNNMbyqPsaKRoAbzCMw1_N7jB4S3_JkBdkff_VlFcIKxR-2Hzu9g==
|
93
125
|
body:
|
94
126
|
encoding: UTF-8
|
95
127
|
string: '{"value":"82"}'
|
96
128
|
http_version:
|
97
|
-
recorded_at:
|
129
|
+
recorded_at: Tue, 10 Nov 2020 22:58:37 GMT
|
98
130
|
recorded_with: VCR 4.0.0
|
@@ -7,32 +7,40 @@ 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.
|
11
|
+
- ScormEngine Ruby Gem 0.8.2
|
14
12
|
Authorization:
|
15
13
|
- Basic <BASIC_AUTH>
|
16
14
|
response:
|
17
15
|
status:
|
18
16
|
code: 404
|
19
|
-
message:
|
17
|
+
message: Not Found
|
20
18
|
headers:
|
21
19
|
content-type:
|
22
20
|
- application/json
|
23
|
-
date:
|
24
|
-
- Fri, 27 Jul 2018 23:29:58 GMT
|
25
|
-
server:
|
26
|
-
- nginx
|
27
|
-
vary:
|
28
|
-
- Accept-Encoding
|
29
21
|
content-length:
|
30
|
-
- '
|
22
|
+
- '65'
|
31
23
|
connection:
|
32
|
-
-
|
24
|
+
- close
|
25
|
+
date:
|
26
|
+
- Tue, 10 Nov 2020 22:57:34 GMT
|
27
|
+
p3p:
|
28
|
+
- CP="NOI"
|
29
|
+
server:
|
30
|
+
- Apache
|
31
|
+
x-xss-protection:
|
32
|
+
- 1; mode=block
|
33
|
+
x-cache:
|
34
|
+
- Error from cloudfront
|
35
|
+
via:
|
36
|
+
- 1.1 94fe3b4b13cd22608780ecba80f5ca65.cloudfront.net (CloudFront)
|
37
|
+
x-amz-cf-pop:
|
38
|
+
- SLC50-C1
|
39
|
+
x-amz-cf-id:
|
40
|
+
- Z_hmzRhoz8f6wgrMt5qTs6o43BqSG0KzORNq73edjnymllT6EDst0g==
|
33
41
|
body:
|
34
|
-
encoding:
|
35
|
-
string: '{"message":"
|
42
|
+
encoding: UTF-8
|
43
|
+
string: '{"message":"Registration ID ''reg-does-not-exist'' does not exist"}'
|
36
44
|
http_version:
|
37
|
-
recorded_at:
|
45
|
+
recorded_at: Tue, 10 Nov 2020 22:57:35 GMT
|
38
46
|
recorded_with: VCR 4.0.0
|
@@ -7,48 +7,40 @@ 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.
|
11
|
+
- ScormEngine Ruby Gem 0.8.2
|
14
12
|
Authorization:
|
15
13
|
- Basic <BASIC_AUTH>
|
16
14
|
response:
|
17
15
|
status:
|
18
16
|
code: 200
|
19
|
-
message:
|
17
|
+
message: OK
|
20
18
|
headers:
|
21
19
|
content-type:
|
22
20
|
- application/json
|
23
|
-
date:
|
24
|
-
- Fri, 27 Jul 2018 23:29:55 GMT
|
25
|
-
server:
|
26
|
-
- nginx
|
27
|
-
vary:
|
28
|
-
- Accept-Encoding
|
29
21
|
content-length:
|
30
|
-
- '
|
22
|
+
- '20'
|
31
23
|
connection:
|
32
|
-
-
|
24
|
+
- close
|
25
|
+
date:
|
26
|
+
- Tue, 10 Nov 2020 22:57:35 GMT
|
27
|
+
p3p:
|
28
|
+
- CP="NOI"
|
29
|
+
server:
|
30
|
+
- Apache
|
31
|
+
x-xss-protection:
|
32
|
+
- 1; mode=block
|
33
|
+
x-cache:
|
34
|
+
- Miss from cloudfront
|
35
|
+
via:
|
36
|
+
- 1.1 7a609f410daa3b15339ef0cc23dbb296.cloudfront.net (CloudFront)
|
37
|
+
x-amz-cf-pop:
|
38
|
+
- SLC50-C1
|
39
|
+
x-amz-cf-id:
|
40
|
+
- mGgWJgrKb-04tMZh0gamYF2jMpDDomnNG_RCoLwmz938XhnisInq_Q==
|
33
41
|
body:
|
34
|
-
encoding:
|
35
|
-
string: '{"launchHistory":[
|
36
|
-
20:41:26 PM","launchTimeUtc":"07/25/2018 20:41:26 PM","exitTime":"07/25/2018
|
37
|
-
20:41:36 PM","exitTimeUtc":"07/25/2018 20:41:36 PM","completionStatus":"Incomplete","successStatus":"Failed","totalSecondsTracked
|
38
|
-
":25.7,"lastRuntimeUpdate":"07/25/2018 20:41:36 PM","lastRuntimeUpdateUtc":"07/25/2018
|
39
|
-
20:41:36 PM"},{"id":"testing-golf-explained-registration-1","instanceId":0.0,"launchTime":"07/25/2018
|
40
|
-
20:02:14 PM","launchTimeUtc":"07/25/2018 20:02:14 PM","exitTime":"07/25/2018
|
41
|
-
20:02:24 PM","exitTimeUtc":"07/25/2018 20:02:24 PM","completionStatus":"Incomplete","successStatus":"Failed","totalSecondsTracked
|
42
|
-
":19.3,"lastRuntimeUpdate":"07/25/2018 20:02:24 PM","lastRuntimeUpdateUtc":"07/25/2018
|
43
|
-
20:02:24 PM"},{"id":"testing-golf-explained-registration-1","instanceId":0.0,"launchTime":"07/25/2018
|
44
|
-
20:02:02 PM","launchTimeUtc":"07/25/2018 20:02:02 PM","exitTime":"07/25/2018
|
45
|
-
20:02:14 PM","exitTimeUtc":"07/25/2018 20:02:14 PM","completionStatus":"Incomplete","successStatus":"Failed","totalSecondsTracked
|
46
|
-
":13.94,"lastRuntimeUpdate":"07/25/2018 20:02:14 PM","lastRuntimeUpdateUtc":"07/25/2018
|
47
|
-
20:02:14 PM"},{"id":"testing-golf-explained-registration-1","instanceId":0.0,"launchTime":"07/25/2018
|
48
|
-
20:01:49 PM","launchTimeUtc":"07/25/2018 20:01:49 PM","exitTime":"07/25/2018
|
49
|
-
20:01:59 PM","exitTimeUtc":"07/25/2018 20:01:59 PM","completionStatus":"Incomplete","successStatus":"Failed","totalSecondsTracked
|
50
|
-
":6.77,"lastRuntimeUpdate":"07/25/2018 20:01:59 PM","lastRuntimeUpdateUtc":"07/25/2018
|
51
|
-
20:01:59 PM"}]}'
|
42
|
+
encoding: UTF-8
|
43
|
+
string: '{"launchHistory":[]}'
|
52
44
|
http_version:
|
53
|
-
recorded_at:
|
45
|
+
recorded_at: Tue, 10 Nov 2020 22:57:36 GMT
|
54
46
|
recorded_with: VCR 4.0.0
|
@@ -7,48 +7,40 @@ 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.
|
11
|
+
- ScormEngine Ruby Gem 0.8.2
|
14
12
|
Authorization:
|
15
13
|
- Basic <BASIC_AUTH>
|
16
14
|
response:
|
17
15
|
status:
|
18
16
|
code: 200
|
19
|
-
message:
|
17
|
+
message: OK
|
20
18
|
headers:
|
21
19
|
content-type:
|
22
20
|
- application/json
|
23
|
-
date:
|
24
|
-
- Fri, 27 Jul 2018 23:29:56 GMT
|
25
|
-
server:
|
26
|
-
- nginx
|
27
|
-
vary:
|
28
|
-
- Accept-Encoding
|
29
21
|
content-length:
|
30
|
-
- '
|
22
|
+
- '20'
|
31
23
|
connection:
|
32
|
-
-
|
24
|
+
- close
|
25
|
+
date:
|
26
|
+
- Tue, 10 Nov 2020 22:57:36 GMT
|
27
|
+
p3p:
|
28
|
+
- CP="NOI"
|
29
|
+
server:
|
30
|
+
- Apache
|
31
|
+
x-xss-protection:
|
32
|
+
- 1; mode=block
|
33
|
+
x-cache:
|
34
|
+
- Miss from cloudfront
|
35
|
+
via:
|
36
|
+
- 1.1 ec99de6a8df96b4e008b942ab98e6595.cloudfront.net (CloudFront)
|
37
|
+
x-amz-cf-pop:
|
38
|
+
- SLC50-C1
|
39
|
+
x-amz-cf-id:
|
40
|
+
- hYt9UJ6CvCcSUeM2YDx903U1mq8Do7gqevakWTL2RG8ue_pNLBCd6A==
|
33
41
|
body:
|
34
|
-
encoding:
|
35
|
-
string: '{"launchHistory":[
|
36
|
-
20:41:26 PM","launchTimeUtc":"07/25/2018 20:41:26 PM","exitTime":"07/25/2018
|
37
|
-
20:41:36 PM","exitTimeUtc":"07/25/2018 20:41:36 PM","completionStatus":"Incomplete","successStatus":"Failed","totalSecondsTracked
|
38
|
-
":25.7,"lastRuntimeUpdate":"07/25/2018 20:41:36 PM","lastRuntimeUpdateUtc":"07/25/2018
|
39
|
-
20:41:36 PM"},{"id":"testing-golf-explained-registration-1","instanceId":0.0,"launchTime":"07/25/2018
|
40
|
-
20:02:14 PM","launchTimeUtc":"07/25/2018 20:02:14 PM","exitTime":"07/25/2018
|
41
|
-
20:02:24 PM","exitTimeUtc":"07/25/2018 20:02:24 PM","completionStatus":"Incomplete","successStatus":"Failed","totalSecondsTracked
|
42
|
-
":19.3,"lastRuntimeUpdate":"07/25/2018 20:02:24 PM","lastRuntimeUpdateUtc":"07/25/2018
|
43
|
-
20:02:24 PM"},{"id":"testing-golf-explained-registration-1","instanceId":0.0,"launchTime":"07/25/2018
|
44
|
-
20:02:02 PM","launchTimeUtc":"07/25/2018 20:02:02 PM","exitTime":"07/25/2018
|
45
|
-
20:02:14 PM","exitTimeUtc":"07/25/2018 20:02:14 PM","completionStatus":"Incomplete","successStatus":"Failed","totalSecondsTracked
|
46
|
-
":13.94,"lastRuntimeUpdate":"07/25/2018 20:02:14 PM","lastRuntimeUpdateUtc":"07/25/2018
|
47
|
-
20:02:14 PM"},{"id":"testing-golf-explained-registration-1","instanceId":0.0,"launchTime":"07/25/2018
|
48
|
-
20:01:49 PM","launchTimeUtc":"07/25/2018 20:01:49 PM","exitTime":"07/25/2018
|
49
|
-
20:01:59 PM","exitTimeUtc":"07/25/2018 20:01:59 PM","completionStatus":"Incomplete","successStatus":"Failed","totalSecondsTracked
|
50
|
-
":6.77,"lastRuntimeUpdate":"07/25/2018 20:01:59 PM","lastRuntimeUpdateUtc":"07/25/2018
|
51
|
-
20:01:59 PM"}]}'
|
42
|
+
encoding: UTF-8
|
43
|
+
string: '{"launchHistory":[]}'
|
52
44
|
http_version:
|
53
|
-
recorded_at:
|
45
|
+
recorded_at: Tue, 10 Nov 2020 22:57:36 GMT
|
54
46
|
recorded_with: VCR 4.0.0
|
@@ -0,0 +1,82 @@
|
|
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
|
+
|
14
|
+
describe "includeMetadata" do
|
15
|
+
let(:subject) { scorm_engine_client.get_app_configuration(includeMetadata: true) }
|
16
|
+
|
17
|
+
it "is successful" do
|
18
|
+
expect(subject.success?).to eq true
|
19
|
+
end
|
20
|
+
|
21
|
+
it "returns metadata in raw_response when included in options" do
|
22
|
+
expect(subject.raw_response.body['settingItems'].first["metadata"]).to_not be_nil
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
describe "#post_app_configuration" do
|
28
|
+
let(:subject) { scorm_engine_client }
|
29
|
+
let(:response) {
|
30
|
+
subject.post_app_configuration(
|
31
|
+
settings: { "UserCountReportLookBackDays" => "90",
|
32
|
+
"UserCountReportDaysBetweenReports" => 20 }
|
33
|
+
)
|
34
|
+
}
|
35
|
+
|
36
|
+
it "is successful" do
|
37
|
+
expect(response.success?).to eq true
|
38
|
+
end
|
39
|
+
|
40
|
+
it "persists the settings" do
|
41
|
+
response # trigger the api
|
42
|
+
configuration = subject.get_app_configuration.result
|
43
|
+
expect(configuration["UserCountReportLookBackDays"]).to eq "90"
|
44
|
+
expect(configuration["UserCountReportDaysBetweenReports"]).to eq "20"
|
45
|
+
|
46
|
+
resp = subject.post_app_configuration(
|
47
|
+
settings: { "UserCountReportLookBackDays" => "365",
|
48
|
+
"UserCountReportDaysBetweenReports" => 30 }
|
49
|
+
)
|
50
|
+
|
51
|
+
sleep 3 # there seems to be a delay between posting new values and when they're updated frd
|
52
|
+
|
53
|
+
configuration = subject.get_app_configuration.result
|
54
|
+
expect(configuration["UserCountReportLookBackDays"]).to eq "365"
|
55
|
+
expect(configuration["UserCountReportDaysBetweenReports"]).to eq "30"
|
56
|
+
end
|
57
|
+
|
58
|
+
it "fails when settings are invalid" do
|
59
|
+
response = subject.post_app_configuration(settings: { "NonExistentSettingTotesBogus" => "YES" })
|
60
|
+
expect(response.success?).to eq false
|
61
|
+
expect(response.status).to eq 400
|
62
|
+
expect(response.message).to match(/NonExistentSettingTotesBogus is not a valid setting ID/)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
describe "#delete_app_configuration" do
|
67
|
+
let(:subject) { scorm_engine_client }
|
68
|
+
let(:response) {
|
69
|
+
subject.delete_app_configuration(setting_id: "UserCountReportLookBackDays")
|
70
|
+
}
|
71
|
+
|
72
|
+
it "is successful" do
|
73
|
+
expect(response.success?).to eq true
|
74
|
+
end
|
75
|
+
it "fails when settings are invalid" do
|
76
|
+
response = subject.delete_app_configuration(setting_id: "NonExistentSettingTotesBogus")
|
77
|
+
expect(response.success?).to eq false
|
78
|
+
expect(response.status).to eq 400
|
79
|
+
expect(response.message).to match(/NonExistentSettingTotesBogus/)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -29,7 +29,7 @@ RSpec.describe ScormEngine::Api::Endpoints::Courses::Configuration do
|
|
29
29
|
response = subject.get_course_configuration(course_id: "nonexistent-course")
|
30
30
|
expect(response.success?).to eq false
|
31
31
|
expect(response.status).to eq 404
|
32
|
-
expect(response.message).to match(/
|
32
|
+
expect(response.message).to match(/'nonexistent-course'/)
|
33
33
|
expect(response.result).to eq nil
|
34
34
|
end
|
35
35
|
end
|
@@ -68,14 +68,14 @@ RSpec.describe ScormEngine::Api::Endpoints::Courses::Configuration do
|
|
68
68
|
response = subject.post_course_configuration(course_id: "nonexistent-course", settings: {})
|
69
69
|
expect(response.success?).to eq false
|
70
70
|
expect(response.status).to eq 404
|
71
|
-
expect(response.message).to match(/
|
71
|
+
expect(response.message).to match(/'nonexistent-course'/)
|
72
72
|
end
|
73
73
|
|
74
74
|
it "fails when settings are invalid" do
|
75
75
|
response = subject.post_course_configuration(course_id: "testing-golf-explained", settings: { "NonExistentSettingTotesBogus" => "YES" })
|
76
76
|
expect(response.success?).to eq false
|
77
77
|
expect(response.status).to eq 400
|
78
|
-
expect(response.message).to match(/
|
78
|
+
expect(response.message).to match(/NonExistentSettingTotesBogus/)
|
79
79
|
end
|
80
80
|
end
|
81
81
|
|
@@ -99,7 +99,7 @@ RSpec.describe ScormEngine::Api::Endpoints::Courses::Configuration do
|
|
99
99
|
response = subject.get_course_configuration_setting(course_id: "nonexistent-course", setting_id: "PlayerStatusRollupModeThresholdScore")
|
100
100
|
expect(response.success?).to eq false
|
101
101
|
expect(response.status).to eq 404
|
102
|
-
expect(response.message).to match(/
|
102
|
+
expect(response.message).to match(/'nonexistent-course'/)
|
103
103
|
expect(response.result).to eq nil
|
104
104
|
end
|
105
105
|
|
@@ -133,7 +133,7 @@ RSpec.describe ScormEngine::Api::Endpoints::Courses::Configuration do
|
|
133
133
|
response = subject.put_course_configuration_setting(course_id: "nonexistent-course", setting_id: "PlayerStatusRollupModeThresholdScore", value: "42")
|
134
134
|
expect(response.success?).to eq false
|
135
135
|
expect(response.status).to eq 404
|
136
|
-
expect(response.message).to match(/
|
136
|
+
expect(response.message).to match(/'nonexistent-course'/)
|
137
137
|
end
|
138
138
|
|
139
139
|
it "fails when setting_id is invalid" do
|