Commit bfeeecdf authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'rails-save-bang-initializers' into 'master'

Fix Rails/SaveBang offenses in spec/initializers

See merge request gitlab-org/gitlab!58049
parents db3b102d 473ccd7f
......@@ -162,8 +162,6 @@ Rails/SaveBang:
- 'spec/graphql/mutations/merge_requests/set_locked_spec.rb'
- 'spec/graphql/mutations/merge_requests/set_wip_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/backup/manager_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
end
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)
end
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
......
......@@ -13,11 +13,13 @@ RSpec.describe 'Fog::Storage::GoogleXML::File', :fog_requests do
end
let(:file) do
# rubocop:disable Rails/SaveBang
directory = storage.directories.create(key: 'data')
directory.files.create(
body: 'Hello World!',
key: 'hello_world.txt'
)
# rubocop:enable Rails/SaveBang
end
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