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

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

Fix Rails/SaveBang offenses for ee/spec/services/projects/*

See merge request gitlab-org/gitlab!41332
parents 78ca8903 7de4b36f
...@@ -817,10 +817,6 @@ Rails/SaveBang: ...@@ -817,10 +817,6 @@ Rails/SaveBang:
- 'ee/spec/services/merge_requests/remove_approval_service_spec.rb' - 'ee/spec/services/merge_requests/remove_approval_service_spec.rb'
- 'ee/spec/services/merge_requests/update_blocks_service_spec.rb' - 'ee/spec/services/merge_requests/update_blocks_service_spec.rb'
- 'ee/spec/services/merge_trains/refresh_merge_request_service_spec.rb' - 'ee/spec/services/merge_trains/refresh_merge_request_service_spec.rb'
- 'ee/spec/services/projects/after_rename_service_spec.rb'
- 'ee/spec/services/projects/import_export/export_service_spec.rb'
- 'ee/spec/services/projects/update_mirror_service_spec.rb'
- 'ee/spec/services/projects/update_service_spec.rb'
- 'ee/spec/services/quick_actions/interpret_service_spec.rb' - 'ee/spec/services/quick_actions/interpret_service_spec.rb'
- 'ee/spec/services/slash_commands/global_slack_handler_spec.rb' - 'ee/spec/services/slash_commands/global_slack_handler_spec.rb'
- 'ee/spec/services/start_pull_mirroring_service_spec.rb' - 'ee/spec/services/start_pull_mirroring_service_spec.rb'
......
---
title: Fix Rails/SaveBang offenses for ee/spec/services/projects/*
merge_request: 41332
author: Rajendra Kadam
type: fixed
...@@ -41,7 +41,7 @@ RSpec.describe Projects::AfterRenameService do ...@@ -41,7 +41,7 @@ RSpec.describe Projects::AfterRenameService do
def service_execute def service_execute
# AfterRenameService is called by UpdateService after a successful model.update # AfterRenameService is called by UpdateService after a successful model.update
# the initialization will include before and after paths values # the initialization will include before and after paths values
project.update(path: path_after_rename) project.update!(path: path_after_rename)
described_class.new(project, path_before: path_before_rename, full_path_before: full_path_before_rename).execute described_class.new(project, path_before: path_before_rename, full_path_before: full_path_before_rename).execute
end end
......
...@@ -27,7 +27,7 @@ RSpec.describe Projects::ImportExport::ExportService do ...@@ -27,7 +27,7 @@ RSpec.describe Projects::ImportExport::ExportService do
context 'group-level custom project templates' do context 'group-level custom project templates' do
before do before do
group.update(custom_project_templates_group_id: subgroup.id) group.update!(custom_project_templates_group_id: subgroup.id)
end end
it 'succeeds' do it 'succeeds' do
......
...@@ -228,7 +228,7 @@ RSpec.describe Projects::UpdateMirrorService do ...@@ -228,7 +228,7 @@ RSpec.describe Projects::UpdateMirrorService do
let(:protected_branch_name) { "#{branch_prefix}existing-branch" } let(:protected_branch_name) { "#{branch_prefix}existing-branch" }
before do before do
project.update(only_mirror_protected_branches: true) project.update!(only_mirror_protected_branches: true)
end end
it 'creates a new protected branch' do it 'creates a new protected branch' do
...@@ -321,7 +321,7 @@ RSpec.describe Projects::UpdateMirrorService do ...@@ -321,7 +321,7 @@ RSpec.describe Projects::UpdateMirrorService do
let(:pull_mirror_branch_prefix) { 'upstream/' } let(:pull_mirror_branch_prefix) { 'upstream/' }
before do before do
project.update(pull_mirror_branch_prefix: pull_mirror_branch_prefix) project.update!(pull_mirror_branch_prefix: pull_mirror_branch_prefix)
end end
it "doesn't create unprefixed branches" do it "doesn't create unprefixed branches" do
......
...@@ -142,7 +142,7 @@ RSpec.describe Projects::UpdateService, '#execute' do ...@@ -142,7 +142,7 @@ RSpec.describe Projects::UpdateService, '#execute' do
context 'when enabling a wiki' do context 'when enabling a wiki' do
it 'creates a RepositoryUpdatedEvent' do it 'creates a RepositoryUpdatedEvent' do
project.project_feature.update(wiki_access_level: ProjectFeature::DISABLED) project.project_feature.update!(wiki_access_level: ProjectFeature::DISABLED)
project.reload project.reload
expect do expect do
...@@ -157,7 +157,7 @@ RSpec.describe Projects::UpdateService, '#execute' do ...@@ -157,7 +157,7 @@ RSpec.describe Projects::UpdateService, '#execute' do
context 'when we update project but not enabling a wiki' do context 'when we update project but not enabling a wiki' do
context 'when the wiki is disabled' do context 'when the wiki is disabled' do
it 'does not create a RepositoryUpdatedEvent' do it 'does not create a RepositoryUpdatedEvent' do
project.project_feature.update(wiki_access_level: ProjectFeature::DISABLED) project.project_feature.update!(wiki_access_level: ProjectFeature::DISABLED)
expect do expect do
result = update_project(project, user, { name: 'test1' }) result = update_project(project, user, { name: 'test1' })
...@@ -170,7 +170,7 @@ RSpec.describe Projects::UpdateService, '#execute' do ...@@ -170,7 +170,7 @@ RSpec.describe Projects::UpdateService, '#execute' do
context 'when the wiki was already enabled' do context 'when the wiki was already enabled' do
it 'does not create a RepositoryUpdatedEvent' do it 'does not create a RepositoryUpdatedEvent' do
project.project_feature.update(wiki_access_level: ProjectFeature::ENABLED) project.project_feature.update!(wiki_access_level: ProjectFeature::ENABLED)
expect do expect do
result = update_project(project, user, { name: 'test1' }) result = update_project(project, user, { name: 'test1' })
...@@ -189,7 +189,7 @@ RSpec.describe Projects::UpdateService, '#execute' do ...@@ -189,7 +189,7 @@ RSpec.describe Projects::UpdateService, '#execute' do
end end
it 'does not create a RepositoryUpdatedEvent when enabling a wiki' do it 'does not create a RepositoryUpdatedEvent when enabling a wiki' do
project.project_feature.update(wiki_access_level: ProjectFeature::DISABLED) project.project_feature.update!(wiki_access_level: ProjectFeature::DISABLED)
project.reload project.reload
expect do expect do
...@@ -230,7 +230,7 @@ RSpec.describe Projects::UpdateService, '#execute' do ...@@ -230,7 +230,7 @@ RSpec.describe Projects::UpdateService, '#execute' do
context 'when there are merge requests in merge train' do context 'when there are merge requests in merge train' do
before do before do
stub_licensed_features(merge_pipelines: true, merge_trains: true) stub_licensed_features(merge_pipelines: true, merge_trains: true)
project.update(merge_pipelines_enabled: true) project.update!(merge_pipelines_enabled: true)
end end
let!(:first_merge_request) do let!(:first_merge_request) 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