You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: contributing/quickstart.md
+18-1
Original file line number
Diff line number
Diff line change
@@ -35,16 +35,33 @@ With your docker server running:
35
35
2. You'll now be in the terminal shell - run `RAILS_ENV=test rspec`
36
36
37
37
You may want to consider the following options to make the test suite run faster:
38
+
- Use `spring` to preload Rails with `bin/spring` - this all test runs after the first significantly faster
39
+
- Set `SKIP_PRETEST_SETUP=true` in `.env.test.local` (you may need to create this file)
40
+
- This will skip database pre-population with seed data, which is used by legacy tests and is not needed if you are running an isolated set of tests which only rely on factories. WE SHOULD NOT BE WRITING ANY NEW TESTS WHICH USE THE SEED DATA! Use factories instead.
38
41
- Add `--fail-fast` to have the suit terminate after the first failure
39
42
- Specify a folder/filename to limit how many tests get executed
40
43
41
-
A full command using these options would look like: `RAILS_ENV=test rspec spec/features/register_for_competition_spec.rb --fail-fast`
44
+
A full command using these options would look like: `RAILS_ENV=test bin/spring rspec spec/features/register_for_competition_spec.rb --fail-fast`
#### 1. `id not found: 333`, full error output as follows:
54
+
```
55
+
An error occurred while loading ./spec/models/light_result_spec.rb.
56
+
Failure/Error: self.c_find(id) || raise("id not found: #{id}")
57
+
58
+
RuntimeError:
59
+
id not found: 333
60
+
```
61
+
62
+
Run `RAILS_ENV=test bin/rake db:reset` in your docker container - the error indicates an improperly populated database, which this command will resolve.
63
+
64
+
48
65
----
49
66
50
67
[^1]: The website can also be run with `rails server` - see [Running with Rails](/guides/running_with_rails)
0 commit comments