Skip to content

Fix Rubocop rule of RSpec/BeforeAllRoleAssignment

Baodong请求将fix-graceful-rubocop合并到main-jh

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.

Baodong 编辑于

合并请求报告

加载中