This pull request allows the app to read in those JSON files if a particular Setting key "use_course_json" is present. The default is to not have that variable be in the Settings file, so we can try out how the app behaves in staging first by manually adding that setting. The tests have been updated to pretend the use_course_json setting is present.
A subsequent pull request will do the following to switch the course reserves process over to using the MaIS APIs:
Update schedule.rb so it runs the fetch_courses rake task instead of fetch_xml
Remove the setting based option to use the MaIS API JSON and switch over entirely (and remove the registry harvester XML pathway)
Update the tests so they no longer rely on the "use_course_json" setting (since they will no longer have to)
How to test this pull request:
There are files on staging with the resulting JSON from the APIs (under the lib/course_work_content directory). If you copy these over to your local lib/course_work_content directory, then start the app as you normally would, and then click on "create new reserve list", you should see several pages of courses listed.
Previous pull request, starting with https://github.com/sul-dlss/course_reserves/pull/474, helped setup a rake task that could be run to generate JSON files with course information from the MaIS APIs.
This pull request allows the app to read in those JSON files if a particular Setting key "use_course_json" is present. The default is to not have that variable be in the Settings file, so we can try out how the app behaves in staging first by manually adding that setting. The tests have been updated to pretend the use_course_json setting is present.
A subsequent pull request will do the following to switch the course reserves process over to using the MaIS APIs:
How to test this pull request: