Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Here comes the unit test!
To test locally, run
bundle exec rspec. By default, client - server communication is mocked by vcr, which uses local casettes recorded from production server.To test against production server, set a test api key as
SCALE_TEST_API_KEYand runbundle exec rake spec:production, which sets environment variableSCALE_TEST_SERVERtoproduction. It will also update new client - server communication in the cassette.Please note that updating the cassettes will break existing specs. This is because 1) the server may return random results for test api key, and 2) some of the cassettes have been modified specifically for the specs. So after the update, either the cassettes or the specs need to manually revised.