MyUSA uses several different tools for testing various aspects of its operation:
- Rspec, a behavior-driven development testing framework for Ruby
- Capybara, a library for integration testing
- Code Climate, a service for automated code reviews
These testing mechanisms use some additional tools to get what they need done
- Site Prism, a simple DSL for the Page-Object Model used for Selenium view testing
- Database Cleaner, cleans the test database between tests
- Poltergeist, a PhantomJS driver for Capybara
- Factory Girl, an alternative to fixtures for loading test records
- Fakeweb, a library for mocking/stubbing web requests within tests
- Shoulda Matchers, some additional matchers for Rspec
- Timecop, a utility for testing time-sensitive actions
- Capybara Email, test email actions within Capybara
- SMS Spec, a library for testing SMS messages within Rspec and Cucumber
All of these are installed automatically when you run the bundle install
step within INSTALL.md, but you will also have to run an additional command to install PhantomJS locally:
brew install phantomjs
To run the tests, simply type this at the command line
bundle exec rake
This will run for a while and print out a .
to the screen for every test that runs successfully. When it is finished, you should see something like this
Pending:
Api::V1 Authorized Scopes API need to figure out how to query for scopes with Doorkeeper
# No reason given
# ./spec/requests/v1/api_spec.rb:344
Api::V1 GET /api/v1/profile when the user queried exists when the schema parameter is set need to understand Schema.org requirement
# No reason given
# ./spec/requests/v1/api_spec.rb:107
Finished in 28.09 seconds (files took 4.35 seconds to load)
386 examples, 0 failures, 2 pending
There may be several tests that are marked as pending. These are tests that were deactivated for some reason or another and do not necessarily indicate a test failure. There is only a problem if you see a failures
number that is greater than 0.