Commit bab74f4f authored by Rajendra Kadam's avatar Rajendra Kadam Committed by Peter Leitzen

Fix Rails/SaveBang offenses

Fixes Rails/SaveBang cop for spec files in ee/spec/models/concerns/*
parent 0ced66ba
...@@ -703,9 +703,6 @@ Rails/SaveBang: ...@@ -703,9 +703,6 @@ Rails/SaveBang:
- 'ee/spec/models/burndown_spec.rb' - 'ee/spec/models/burndown_spec.rb'
- 'ee/spec/models/ci/pipeline_spec.rb' - 'ee/spec/models/ci/pipeline_spec.rb'
- 'ee/spec/models/ci/subscriptions/project_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/appearance_spec.rb'
- 'ee/spec/models/ee/ci/job_artifact_spec.rb' - 'ee/spec/models/ee/ci/job_artifact_spec.rb'
- 'ee/spec/models/ee/protected_branch_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 ...@@ -23,7 +23,7 @@ RSpec.describe ApproverMigrateHook do
end end
context 'when rule already exists' do 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 it 'reuses rule' do
expect do expect do
......
...@@ -6,11 +6,11 @@ RSpec.describe DeprecatedApprovalsBeforeMerge do ...@@ -6,11 +6,11 @@ RSpec.describe DeprecatedApprovalsBeforeMerge do
shared_examples 'with approvals before merge deprecated' do shared_examples 'with approvals before merge deprecated' do
context 'updating approvals_before_merge' do context 'updating approvals_before_merge' do
it 'creates any_approver rule' 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) 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) expect_approvals_before_merge_to_be_updated(5)
end end
......
...@@ -154,7 +154,7 @@ RSpec.describe Note, :elastic do ...@@ -154,7 +154,7 @@ RSpec.describe Note, :elastic do
shared_examples 'notes finder' do |user_type, no_of_notes| 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 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)) issue = create(:issue, :confidential, author: create(:user))
Sidekiq::Testing.inline! do 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