-
Notifications
You must be signed in to change notification settings - Fork 0
Running The Test Suite
One Click Core comes with with a full test suite. These tests are written with Rspec. This doc goes through how to run the test suite. Tests are written in a BDD manner so the unit tests should read like: "Describe a controller; in this context; it should do xyz; expect abc to have happened"
Note that a test database is required to run the tests, which should be set up for you when you run bundle exec rake db:migrate
.
You can run Rspec through the terminal to test One Click. You can run One Click specific tests like so:
- run an individual test:
bundle exec rspec spec/controllers/admin/users_controller_spec.rb
- run tests in a directory:
bundle exec rspec spec/controllers/admin
- run all tests:
bundle exec rspec spec
- run failing tests in the admin controllers test suite
bundle exec rspec spec/controllers/admin --only-failures
RubyMine makes it very convenient to run any part of the test suite. Simply go into the project tab in Ruby Mine's side bar, navigate down to the spec directory and right click whichever test, or subdirectory you want to run those respective tests, and then click either debug or run specs. It lets you run everything in the Running Tests With The Terminal section only through a GUI instead of the terminal.