specs: reduce BCrypt complexity during tests

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.
This commit is contained in:
Pierre de La Morinerie 2021-11-03 19:37:43 +01:00
parent 0a541d678d
commit 5f2233d07d

View file

@ -76,4 +76,10 @@ Rails.application.configure do
debounce_delay: 500,
status_visible_duration: 500
}
# BCrypt is slow by design - but during tests we want to make it faster
# to compute hashes of passwords.
silence_warnings do
BCrypt::Engine::DEFAULT_COST = BCrypt::Engine::MIN_COST
end
end