diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-27 18:10:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-27 18:10:35 +0300 |
commit | e8aa488899554f5fe4413779f485583d691fd5a8 (patch) | |
tree | e999521cc00b4b958c668e84550a439e559ca431 /spec/tooling | |
parent | 5cb0fa35e709bcd7f9d69e050010e44092a48623 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/tooling')
-rw-r--r-- | spec/tooling/danger/specs/project_factory_suggestion_spec.rb | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/spec/tooling/danger/specs/project_factory_suggestion_spec.rb b/spec/tooling/danger/specs/project_factory_suggestion_spec.rb index 95ffcfb1460..9b10ab1a6f4 100644 --- a/spec/tooling/danger/specs/project_factory_suggestion_spec.rb +++ b/spec/tooling/danger/specs/project_factory_suggestion_spec.rb @@ -18,9 +18,17 @@ RSpec.describe Tooling::Danger::Specs::ProjectFactorySuggestion, feature_categor %<suggested_line>s ``` - Project creations are very slow. Use `let_it_be`, `build` or `build_stubbed` if possible. - See [testing best practices](https://docs.gitlab.com/ee/development/testing_guide/best_practices.html#optimize-factory-usage) - for background information and alternative options. + Project creations are very slow. Using `let_it_be`, `build` or `build_stubbed` can improve test performance. + + Warning: `let_it_be` may not be suitable if your test modifies data as this could result in state leaks! + + In those cases, please use `let_it_be_with_reload` or `let_it_be_with_refind` instead. + + If your are unsure which is the right method to use, + please refer to [testing best practices](https://docs.gitlab.com/ee/development/testing_guide/best_practices.html#optimize-factory-usage) + for background information and alternative options for optimizing factory usage. + + Feel free to ignore this comment if you know `let` or `let!` are the better options and/or worry about causing state leaks. MARKDOWN end |