-
Notifications
You must be signed in to change notification settings - Fork 33
Development Testing
Luca Brügger edited this page May 10, 2022
·
6 revisions
There's 3 different kinds of tests in Cryptopus:
Those are the Ruby-Land tests and are for testing the Rails backend.
To run a specific test file:
docker-compose exec rails bash
rspec spec/controllers/session_controller_spec.rb
or for even a specific test case, add the line number
rspec spec/controllers/session_controller_spec.rb:42
backend specs reside all in the spec folder:
folder | content |
---|---|
controllers | controller tests |
integration | backend/api tests independent from controllers |
migrations | tests for db migrations |
policies | tests for pundit policies |
Those tests are running the full stack. So there's a webbrowser (firefox) startet in the background and tests are clicking/navigating through the application.
docker-compose exec ember yarn build --prod
docker-compose exec rails ./bin/prepare-frontend.sh
docker-compose exec rails bash
rspec --tag type:system spec/system/settings_system_spec.rb
for running system specs with visible browser (for debugging)
HEADLESS=false rspec --tag type:system spec/system/settings_system_spec.rb
Simply visit localhost:4200/tests
Edited tests will automatically restart when saved.