Commit d45850a6 authored by Huzaifa Iftikhar's avatar Huzaifa Iftikhar Committed by Luke Duncalfe

Fix Rails/SaveBang Rubocop offenses for commit models

parent e6e204f3
......@@ -297,8 +297,6 @@ Rails/SaveBang:
- 'spec/models/application_record_spec.rb'
- 'spec/models/application_setting_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/deploy_keys_project_spec.rb'
- 'spec/models/deploy_token_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
context 'that is found' do
before do
# Artificially mark as completed.
merge_request.update(merge_commit_sha: merge_commit.id)
merge_request.update!(merge_commit_sha: merge_commit.id)
end
it do
......
......@@ -213,12 +213,12 @@ RSpec.describe CommitStatus do
context 'when it is canceled' do
before do
commit_status.update(status: 'canceled')
commit_status.update!(status: 'canceled')
end
context 'when there is auto_canceled_by' do
before do
commit_status.update(auto_canceled_by: create(:ci_empty_pipeline))
commit_status.update!(auto_canceled_by: create(:ci_empty_pipeline))
end
it 'is auto canceled' do
......@@ -660,7 +660,7 @@ RSpec.describe CommitStatus do
end
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
......
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