Commit 473ccd7f authored by Abdul Wadood's avatar Abdul Wadood Committed by Rémy Coutable

Fix Rails/SaveBang offenses in spec/initializers

parent 143bbd46
...@@ -203,8 +203,6 @@ Rails/SaveBang: ...@@ -203,8 +203,6 @@ Rails/SaveBang:
- 'spec/graphql/mutations/merge_requests/set_locked_spec.rb' - 'spec/graphql/mutations/merge_requests/set_locked_spec.rb'
- 'spec/graphql/mutations/merge_requests/set_wip_spec.rb' - 'spec/graphql/mutations/merge_requests/set_wip_spec.rb'
- 'spec/graphql/resolvers/boards_resolver_spec.rb' - 'spec/graphql/resolvers/boards_resolver_spec.rb'
- 'spec/initializers/active_record_locking_spec.rb'
- 'spec/initializers/fog_google_https_private_urls_spec.rb'
- 'spec/lib/after_commit_queue_spec.rb' - 'spec/lib/after_commit_queue_spec.rb'
- 'spec/lib/backup/manager_spec.rb' - 'spec/lib/backup/manager_spec.rb'
- 'spec/lib/gitlab/alerting/alert_spec.rb' - 'spec/lib/gitlab/alerting/alert_spec.rb'
......
---
title: Fix Rails/SaveBang rubocop offenses in spec/initializers
merge_request: 58049
author: Abdul Wadood @abdulwd
type: fixed
...@@ -11,13 +11,13 @@ RSpec.describe 'ActiveRecord locking' do ...@@ -11,13 +11,13 @@ RSpec.describe 'ActiveRecord locking' do
end end
it 'can be updated' do it 'can be updated' do
issue.update(title: "New title") issue.update!(title: "New title")
expect(issue.reload.lock_version).to eq(new_lock_version) expect(issue.reload.lock_version).to eq(new_lock_version)
end end
it 'can be deleted' do it 'can be deleted' do
expect { issue.destroy }.to change { Issue.count }.by(-1) expect { issue.destroy! }.to change { Issue.count }.by(-1)
end end
end end
......
...@@ -13,11 +13,13 @@ RSpec.describe 'Fog::Storage::GoogleXML::File', :fog_requests do ...@@ -13,11 +13,13 @@ RSpec.describe 'Fog::Storage::GoogleXML::File', :fog_requests do
end end
let(:file) do let(:file) do
# rubocop:disable Rails/SaveBang
directory = storage.directories.create(key: 'data') directory = storage.directories.create(key: 'data')
directory.files.create( directory.files.create(
body: 'Hello World!', body: 'Hello World!',
key: 'hello_world.txt' key: 'hello_world.txt'
) )
# rubocop:enable Rails/SaveBang
end end
it 'delegates to #get_https_url' do it 'delegates to #get_https_url' 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