Commit 2c200e1
committed
Configure CEfE generator randomness with RSpec seed
We still have at least one flakey spec [1] and I noticed it depends on
the `verified_school` factory which uses the
`ForEducationCodeGenerator.generate` method to set the `School#code`. On
the offchance this is causing some kind of non-deterministic problem and
to make that generator more deterministic in specs, I thought it would
be worthwhile using the RSpec seed to seed the random number generator
(RNG) used by `ForEducationCodeGenerator.generate`.
The changes in this commit allow the RNG to be overridden and adds file
in `spec/support` to do this in specs so it uses the RSpec seed.
[1]: https://github.com/RaspberryPiFoundation/editor-api/blob/f397e870f2a33cce1f53b9104c52314f5233572c/spec/concepts/school_teacher/invite_spec.rb#L14-L171 parent 224850b commit 2c200e1
File tree
3 files changed
+14
-4
lines changed- lib
- spec
- lib
- support
3 files changed
+14
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
6 | 10 | | |
7 | | - | |
| 11 | + | |
8 | 12 | | |
9 | 13 | | |
10 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | | - | |
| 8 | + | |
11 | 9 | | |
12 | 10 | | |
13 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
0 commit comments