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:
- 'spec/requests/api/notes_spec.rb'
- 'spec/requests/api/pipeline_schedules_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/services/auth/container_registry_authentication_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
context 'and build created by' do
before do
build.update(user: user)
build.update!(user: user)
project.add_reporter(user)
end
......
......@@ -786,7 +786,7 @@ RSpec.describe 'Git LFS API and storage' do
let(:authorization) { authorize_deploy_key }
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
it_behaves_like 'pushes new LFS objects', renew_authorization: false
......@@ -991,7 +991,7 @@ RSpec.describe 'Git LFS API and storage' do
context 'and workhorse requests upload finalize for a new LFS object' do
before do
lfs_object.destroy
lfs_object.destroy!
end
context 'with object storage disabled' do
......@@ -1009,7 +1009,7 @@ RSpec.describe 'Git LFS API and storage' do
end
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',
body: 'content'
)
......@@ -1080,7 +1080,7 @@ RSpec.describe 'Git LFS API and storage' do
context 'without the lfs object' do
before do
lfs_object.destroy
lfs_object.destroy!
end
it 'rejects slashes in the tempfile name (path traversal)' do
......
......@@ -5,8 +5,8 @@ require 'spec_helper'
RSpec.describe 'view user notifications' do
let(:user) do
create(:user) do |user|
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: 'original@example.com', confirmed_at: Time.current)
user.emails.create!(email: 'new@example.com', confirmed_at: Time.current)
user.notification_email = 'original@example.com'
user.save!
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