Repository navigation
Add rspec - #12
Merged
Merged
Add rspec#12
Conversation
* Activate travis ci * Set up rspec files * Add more tests for scale.rb * Fix example labels in readme * Depend on webmock and vcr for testing * Add tests for create-task methods * Use let and test all alias methods * Allow selection of test server * Split each task to its own spec * Unify task specs * Add specs for remaining tasks * Add spec for task list * Update cassettes * Test tasks and task list * Update readme * Use custom serializer to remove headers from cassette * Fix spec for cancellation of valid task * Update task list spec * Use downcase for comments * Remove ruby 2.4.5 * Add rake task spec:production to test against production server * Add notes about unit tests in readme * Revise comment for custom serializer * Revise readme about test
|
Thanks for contributing this! 🎉 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.