Commit 189d4dba authored by Luke Duncalfe's avatar Luke Duncalfe

Merge branch 'issue#220040-fix-rails-savebang-commit-models' into 'master'

Fix Rails/SaveBang Rubocop offenses for commit models

See merge request gitlab-org/gitlab!58069
parents a74d08ad d45850a6
...@@ -218,8 +218,6 @@ Rails/SaveBang: ...@@ -218,8 +218,6 @@ Rails/SaveBang:
- 'spec/models/application_record_spec.rb' - 'spec/models/application_record_spec.rb'
- 'spec/models/application_setting_spec.rb' - 'spec/models/application_setting_spec.rb'
- 'spec/models/clusters/applications/helm_spec.rb' - 'spec/models/clusters/applications/helm_spec.rb'
- 'spec/models/commit_spec.rb'
- 'spec/models/commit_status_spec.rb'
- 'spec/models/container_repository_spec.rb' - 'spec/models/container_repository_spec.rb'
- 'spec/models/design_management/version_spec.rb' - 'spec/models/design_management/version_spec.rb'
- 'spec/models/diff_discussion_spec.rb' - 'spec/models/diff_discussion_spec.rb'
......
---
title: Fix Rails/SaveBang Rubocop offenses for commit models
merge_request: 58069
author: Huzaifa Iftikhar @huzaifaiftikhar
type: fixed
...@@ -526,7 +526,7 @@ eos ...@@ -526,7 +526,7 @@ eos
context 'that is found' do context 'that is found' do
before do before do
# Artificially mark as completed. # Artificially mark as completed.
merge_request.update(merge_commit_sha: merge_commit.id) merge_request.update!(merge_commit_sha: merge_commit.id)
end end
it do it do
......
...@@ -213,12 +213,12 @@ RSpec.describe CommitStatus do ...@@ -213,12 +213,12 @@ RSpec.describe CommitStatus do
context 'when it is canceled' do context 'when it is canceled' do
before do before do
commit_status.update(status: 'canceled') commit_status.update!(status: 'canceled')
end end
context 'when there is auto_canceled_by' do context 'when there is auto_canceled_by' do
before do before do
commit_status.update(auto_canceled_by: create(:ci_empty_pipeline)) commit_status.update!(auto_canceled_by: create(:ci_empty_pipeline))
end end
it 'is auto canceled' do it 'is auto canceled' do
...@@ -610,7 +610,7 @@ RSpec.describe CommitStatus do ...@@ -610,7 +610,7 @@ RSpec.describe CommitStatus do
end end
it "raise exception when trying to update" do it "raise exception when trying to update" do
expect { commit_status.save }.to raise_error(ActiveRecord::StaleObjectError) expect { commit_status.save! }.to raise_error(ActiveRecord::StaleObjectError)
end end
end end
......
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