Skip to content

Commit afab3aa

Browse files
mjankowskiavdi
andauthored
Add section on preparing to run tests (#1821)
Begin documenting necessary prep to have green tests in local development. Without running `assets:precompile` in the `test` env, `/public/packs-test` won't be generated and a number of tests will fail with misleading webmock errors. Co-authored-by: Avdi Grimm <avdi@users.noreply.github.com>
1 parent 4820fca commit afab3aa

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

content/en/dev/setup.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,20 @@ In order to work with emails, you'll need Sidekiq, Redis and PostgreSQL running,
9090

9191
If you're developing in docker, you'll need to set the `REMOTE_DEV=true` environment variable.
9292

93+
## Preparing to run tests
94+
95+
Set up the test database:
96+
97+
```sh
98+
RAILS_ENV=test bin/rails db:setup
99+
```
100+
101+
Generate test-mode precompiled assets:
102+
103+
```sh
104+
RAILS_ENV=test bin/rails assets:precompile
105+
```
106+
93107
## Useful commands for testing {#testing}
94108

95109
`bin/rspec`

0 commit comments

Comments
 (0)