Running bin/test
will run our complete test suite including front-end, back-end and system specs.
To run each of these individully:
- Front end:
yarn test
oryarn test -w
(to watch for changes and rerun) - Back end:
bin/rspec
orrerun bin/rspec spec/some/dir/or_spec.rb
(to watch for changes and rerun) - System specs:
bin/rspec spec/system
. Can be run in-browser or with headless chrome. Seespec/rails_helper.rb
.
When writing rspec tests within the spec/request directory, you can use Warden::Test:Helpers
which give you access to the login_as(user, :scope => :user)
method, as well as the logout
method.
You use FactoryBot.create(:user)
before the login_as
method and pass it in as the required resource variable.
We have a heroku install for testing! http://mutual-aid-demo.herokuapp.com/
- username:
testuser@example.com
- password:
test with zest
To deploy a WIP branch (not main
):
git push <test-app-git-remote> <your-branch>:main
See this guide for how to set up heroku git remotes.
↩ Back to README