During system tests, we don't want the headless browser to load
external resources:
- It is faster (we don't wait for external resources to be loaded)
- It avoids leaking our test setup to external service
Fixes#6982
BCrypt is used to compute Instructeur tokens, and takes a surprisingly
ong time during specs.
Reducing the complexity to speed it up.
Speeds up this spec from 0m 57s to 0m 20s.
When running several individual tests in succession using Spring,
we get an error message:
> zeitwerk error: reloading is disabled because config.cache_classes is true
Caching classes during tests used to be recommended – but Rails 6
now recommands to reload them:
- Spring takes care of the caching for us,
- It makes zeitwerk happy.
See discussion in 65344f254c
A potential downside used to be that when running system tests using
Capybara, each web request would reload the classes, which invalidated
the model objects of the test case. But it seems to be fixed now.