Use let_it_be in ee/spec/models/ee/vulnerability_spec.rb
In ee/spec/models/ee/vulnerability_spec.rb there are multiple tests which recreate resources using let!
, it might be possible to use let_it_be
for them because these don't seem to be updated in tests.
The following discussion from !42200 (merged) should be addressed:
-
@jprovaznik started a discussion: (+2 comments) minor: WDYT about using
let_it_be
for these resources? Ideally only once for all tests (https://docs.gitlab.com/ee/development/testing_guide/best_practices.html#common-test-setup).
Implementation plan
-
backend in ee/spec/models/ee/vulnerability_spec.rb
refactor all tests to use singlelet_it_be
instead of multiplelet!
orlet
, consider usinglet_it_be_with_rewind
orlet_it_be_with_refind
if you need to update Vulnerability during test execution,
Edited by Alan (Maciej) Paruszewski