ahcis-rds / study_finder

StudyFinder is a flexible and configurable application to pull studies from clinicaltrials.gov and augment the data from alternate datasources such as a clinical trials management system.
MIT License
17 stars 4 forks source link

Tame test output #109

Closed cdinger closed 3 years ago

cdinger commented 3 years ago

This cleans up the output when running specs with two changes: turning off elasticsearch output and resolving deprecation warnings.

Elasticsearch

887df05 removes the elasticsearch initializer. It was only needed in the past because we configured the elasticsearch host via a customer environment variable (es_host). This has been replaced with the standard ELASTICSEARCH_URL, which the gems use by default.

The initializer was also forcing log output everywhere—in development, specs, and production. The noisy output makes spec output difficult to read and in production, fills the logs with a lot of unneeded information. We'll still want to enable this when debugging or developing a new feature, but we can opt-in when needed rather than have it turned on everywhere.

Deprecation warnings

b715d21 removes all expect(response).to be_success assertions in the controller specs. This method is clearly using the deprecated success? method under the covers. Since most of the instances of be_success were immediately followed by have_http_status(200), I simply removed them. These are redundant checks.

Behold, the beautiful green dots!

$ rspec
...................................................

Finished in 5.14 seconds (files took 9.85 seconds to load)
51 examples, 0 failures