Commit 3777d420 authored by Peter Leitzen's avatar Peter Leitzen

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

Fix Rails/SaveBang offenses in  spec/requests/

See merge request gitlab-org/gitlab!41392
parents 2e99b514 086fd01d
...@@ -1136,9 +1136,6 @@ Rails/SaveBang: ...@@ -1136,9 +1136,6 @@ Rails/SaveBang:
- 'spec/requests/api/notes_spec.rb' - 'spec/requests/api/notes_spec.rb'
- 'spec/requests/api/pipeline_schedules_spec.rb' - 'spec/requests/api/pipeline_schedules_spec.rb'
- 'spec/requests/api/project_import_spec.rb' - 'spec/requests/api/project_import_spec.rb'
- 'spec/requests/git_http_spec.rb'
- 'spec/requests/lfs_http_spec.rb'
- 'spec/requests/profiles/notifications_controller_spec.rb'
- 'spec/requests/projects/cycle_analytics_events_spec.rb' - 'spec/requests/projects/cycle_analytics_events_spec.rb'
- 'spec/services/auth/container_registry_authentication_service_spec.rb' - 'spec/services/auth/container_registry_authentication_service_spec.rb'
- 'spec/services/auto_merge/base_service_spec.rb' - 'spec/services/auto_merge/base_service_spec.rb'
......
---
title: Fix Rails/SaveBang offenses for 3 files
merge_request: 41392
author: Rajendra Kadam
type: other
...@@ -763,7 +763,7 @@ RSpec.describe 'Git HTTP requests' do ...@@ -763,7 +763,7 @@ RSpec.describe 'Git HTTP requests' do
context 'and build created by' do context 'and build created by' do
before do before do
build.update(user: user) build.update!(user: user)
project.add_reporter(user) project.add_reporter(user)
end end
......
...@@ -786,7 +786,7 @@ RSpec.describe 'Git LFS API and storage' do ...@@ -786,7 +786,7 @@ RSpec.describe 'Git LFS API and storage' do
let(:authorization) { authorize_deploy_key } let(:authorization) { authorize_deploy_key }
let(:update_user_permissions) do let(:update_user_permissions) do
project.deploy_keys_projects.create(deploy_key: key, can_push: true) project.deploy_keys_projects.create!(deploy_key: key, can_push: true)
end end
it_behaves_like 'pushes new LFS objects', renew_authorization: false it_behaves_like 'pushes new LFS objects', renew_authorization: false
...@@ -991,7 +991,7 @@ RSpec.describe 'Git LFS API and storage' do ...@@ -991,7 +991,7 @@ RSpec.describe 'Git LFS API and storage' do
context 'and workhorse requests upload finalize for a new LFS object' do context 'and workhorse requests upload finalize for a new LFS object' do
before do before do
lfs_object.destroy lfs_object.destroy!
end end
context 'with object storage disabled' do context 'with object storage disabled' do
...@@ -1009,7 +1009,7 @@ RSpec.describe 'Git LFS API and storage' do ...@@ -1009,7 +1009,7 @@ RSpec.describe 'Git LFS API and storage' do
end end
let(:tmp_object) do let(:tmp_object) do
fog_connection.directories.new(key: 'lfs-objects').files.create( fog_connection.directories.new(key: 'lfs-objects').files.create( # rubocop: disable Rails/SaveBang
key: 'tmp/uploads/12312300', key: 'tmp/uploads/12312300',
body: 'content' body: 'content'
) )
...@@ -1080,7 +1080,7 @@ RSpec.describe 'Git LFS API and storage' do ...@@ -1080,7 +1080,7 @@ RSpec.describe 'Git LFS API and storage' do
context 'without the lfs object' do context 'without the lfs object' do
before do before do
lfs_object.destroy lfs_object.destroy!
end end
it 'rejects slashes in the tempfile name (path traversal)' do it 'rejects slashes in the tempfile name (path traversal)' do
......
...@@ -5,8 +5,8 @@ require 'spec_helper' ...@@ -5,8 +5,8 @@ require 'spec_helper'
RSpec.describe 'view user notifications' do RSpec.describe 'view user notifications' do
let(:user) do let(:user) do
create(:user) do |user| create(:user) do |user|
user.emails.create(email: 'original@example.com', confirmed_at: Time.current) user.emails.create!(email: 'original@example.com', confirmed_at: Time.current)
user.emails.create(email: 'new@example.com', confirmed_at: Time.current) user.emails.create!(email: 'new@example.com', confirmed_at: Time.current)
user.notification_email = 'original@example.com' user.notification_email = 'original@example.com'
user.save! user.save!
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