Commit f7bf97d4 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch 'issue#220040-fix-rails-savebang-deploy-modules' into 'master'

Fix Rails/SaveBang Rubocop offenses for deployment modules

See merge request gitlab-org/gitlab!58040
parents 2dc7410e a7fee3ed
...@@ -255,9 +255,6 @@ Rails/SaveBang: ...@@ -255,9 +255,6 @@ Rails/SaveBang:
- 'spec/models/commit_spec.rb' - 'spec/models/commit_spec.rb'
- 'spec/models/commit_status_spec.rb' - 'spec/models/commit_status_spec.rb'
- 'spec/models/container_repository_spec.rb' - 'spec/models/container_repository_spec.rb'
- 'spec/models/deploy_keys_project_spec.rb'
- 'spec/models/deploy_token_spec.rb'
- 'spec/models/deployment_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'
- 'spec/models/diff_note_spec.rb' - 'spec/models/diff_note_spec.rb'
......
---
title: Fix Rails/SaveBang Rubocop offenses for deployment modules
merge_request: 58040
author: Huzaifa Iftikhar @huzaifaiftikhar
type: fixed
...@@ -26,7 +26,7 @@ RSpec.describe DeployKeysProject do ...@@ -26,7 +26,7 @@ RSpec.describe DeployKeysProject do
end end
it "doesn't destroy the deploy key" do it "doesn't destroy the deploy key" do
subject.destroy subject.destroy!
expect { deploy_key.reload }.not_to raise_error expect { deploy_key.reload }.not_to raise_error
end end
...@@ -34,7 +34,7 @@ RSpec.describe DeployKeysProject do ...@@ -34,7 +34,7 @@ RSpec.describe DeployKeysProject do
context "when the deploy key is private" do context "when the deploy key is private" do
it "destroys the deploy key" do it "destroys the deploy key" do
subject.destroy subject.destroy!
expect { deploy_key.reload }.to raise_error(ActiveRecord::RecordNotFound) expect { deploy_key.reload }.to raise_error(ActiveRecord::RecordNotFound)
end end
...@@ -49,7 +49,7 @@ RSpec.describe DeployKeysProject do ...@@ -49,7 +49,7 @@ RSpec.describe DeployKeysProject do
end end
it "doesn't destroy the deploy key" do it "doesn't destroy the deploy key" do
subject.destroy subject.destroy!
expect { deploy_key.reload }.not_to raise_error expect { deploy_key.reload }.not_to raise_error
end end
......
...@@ -47,7 +47,7 @@ RSpec.describe DeployToken do ...@@ -47,7 +47,7 @@ RSpec.describe DeployToken do
describe '#ensure_token' do describe '#ensure_token' do
it 'ensures a token' do it 'ensures a token' do
deploy_token.token = nil deploy_token.token = nil
deploy_token.save deploy_token.save!
expect(deploy_token.token).not_to be_empty expect(deploy_token.token).not_to be_empty
end end
......
...@@ -497,7 +497,7 @@ RSpec.describe Deployment do ...@@ -497,7 +497,7 @@ RSpec.describe Deployment do
context 'when the SHA for the deployment does not exist in the repo' do context 'when the SHA for the deployment does not exist in the repo' do
it 'returns false' do it 'returns false' do
deployment.update(sha: Gitlab::Git::BLANK_SHA) deployment.update!(sha: Gitlab::Git::BLANK_SHA)
commit = project.commit commit = project.commit
expect(deployment.includes_commit?(commit)).to be false expect(deployment.includes_commit?(commit)).to be false
......
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