Commit c3b4e4e5 authored by Peter Leitzen's avatar Peter Leitzen

Merge branch 'rails-save-bang-35' into 'master'

Fixes Rails/SaveBang cop for spec files in ee/spec/models/concerns/*

See merge request gitlab-org/gitlab!42839
parents bf6872e4 bab74f4f
......@@ -703,9 +703,6 @@ Rails/SaveBang:
- 'ee/spec/models/burndown_spec.rb'
- 'ee/spec/models/ci/pipeline_spec.rb'
- 'ee/spec/models/ci/subscriptions/project_spec.rb'
- 'ee/spec/models/concerns/approver_migrate_hook_spec.rb'
- 'ee/spec/models/concerns/deprecated_approvals_before_merge_spec.rb'
- 'ee/spec/models/concerns/elastic/note_spec.rb'
- 'ee/spec/models/ee/appearance_spec.rb'
- 'ee/spec/models/ee/ci/job_artifact_spec.rb'
- 'ee/spec/models/ee/protected_branch_spec.rb'
......
---
title: Fixes Rails/SaveBang cop for spec files in ee/spec/models/concerns/*
merge_request: 42839
author: Rajendra Kadam
type: other
......@@ -23,7 +23,7 @@ RSpec.describe ApproverMigrateHook do
end
context 'when rule already exists' do
let!(:approval_rule) { target.approval_rules.create(name: 'foo') }
let!(:approval_rule) { target.approval_rules.create!(name: 'foo') }
it 'reuses rule' do
expect do
......
......@@ -6,11 +6,11 @@ RSpec.describe DeprecatedApprovalsBeforeMerge do
shared_examples 'with approvals before merge deprecated' do
context 'updating approvals_before_merge' do
it 'creates any_approver rule' do
subject.update(approvals_before_merge: 3)
subject.update!(approvals_before_merge: 3)
expect_approvals_before_merge_to_be_updated(3)
subject.update(approvals_before_merge: 5)
subject.update!(approvals_before_merge: 5)
expect_approvals_before_merge_to_be_updated(5)
end
......
......@@ -154,7 +154,7 @@ RSpec.describe Note, :elastic do
shared_examples 'notes finder' do |user_type, no_of_notes|
it "finds #{no_of_notes} notes for #{user_type}", :sidekiq_might_not_need_inline do
superuser = create(user_type)
superuser = create(user_type) # rubocop:disable Rails/SaveBang
issue = create(:issue, :confidential, author: create(:user))
Sidekiq::Testing.inline! do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment