Fix Rubocop rule of RSpec/BeforeAllRoleAssignment
What does this MR do and why?
Fix Rubocop rule of RSpec/BeforeAllRoleAssignment
.
Running RuboCop in graceful mode:
rubocop --parallel --format RuboCop::Formatter::GracefulFormatter
# Checks for let_it_be with before instead of before_all when using `add_*` methods
#
# @example
#
# # bad
# let_it_be(:project) { create(:project) }
# let_it_be(:guest) { create(:user) }
#
# before do
# project.add_guest(guest)
# end
#
# # good
# let_it_be(:project) { create(:project) }
# let_it_be(:guest) { create(:user) }
#
# before_all do
# project.add_guest(guest)
# end
Job link: https://jihulab.com/gitlab-cn/gitlab/-/jobs/8256142
Screenshots or screen recordings
Non-UI
How to set up and validate locally
bundle exec rubocop target_file_path
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
由 Baodong 编辑于