roadmap
roadmap copied to clipboard
Override `Rails.configuration.x.ror.active` During RSpec Tests
Changes proposed in this PR:
-
This PR overrides the value of
Rails.configuration.x.ror.activeto true for the duration of thespec/services/external_apis/ror_service_spec.rbtests. -
Prior to this commit, when setting
Rails.configuration.x.ror.active = falseinconfig/initializers/external_apis/ror.rb, the following errors were encountered after executingbundle exec rspec spec/services/external_apis/ror_service_spec.rb:
Finished in 1.03 seconds (files took 1.2 seconds to load)
37 examples, 5 failures
Failed examples:
rspec ./spec/services/external_apis/ror_service_spec.rb:45 # ExternalApis::RorService#search ROR did not return a 200 status logs the response as an error
rspec ./spec/services/external_apis/ror_service_spec.rb:117 # ExternalApis::RorService#search Successful response from API includes the country in the name (if no website is available)
rspec ./spec/services/external_apis/ror_service_spec.rb:105 # ExternalApis::RorService#search Successful response from API returns both results
rspec ./spec/services/external_apis/ror_service_spec.rb:109 # ExternalApis::RorService#search Successful response from API includes the website in the name (if available)
rspec ./spec/services/external_apis/ror_service_spec.rb:16 # ExternalApis::RorService#ping returns false if an HTTP 200 is NOT returned
The fork of this repo at portagenetwork/roadmap recently deactivated the ROR external API. They implemented the same fix after encountering the same aforementioned failing tests as a result of the config change.