Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
7de4b36f
Commit
7de4b36f
authored
Sep 03, 2020
by
Rajendra Kadam
Committed by
Rémy Coutable
Sep 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Rails/SaveBang offenses for ee/spec/services/projects/*
Fixes Rails/SaveBang cop for spec files
parent
e2e3b618
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
13 deletions
+14
-13
.rubocop_todo.yml
.rubocop_todo.yml
+0
-4
changelogs/unreleased/rails-save-bang-25.yml
changelogs/unreleased/rails-save-bang-25.yml
+5
-0
ee/spec/services/projects/after_rename_service_spec.rb
ee/spec/services/projects/after_rename_service_spec.rb
+1
-1
ee/spec/services/projects/import_export/export_service_spec.rb
...ec/services/projects/import_export/export_service_spec.rb
+1
-1
ee/spec/services/projects/update_mirror_service_spec.rb
ee/spec/services/projects/update_mirror_service_spec.rb
+2
-2
ee/spec/services/projects/update_service_spec.rb
ee/spec/services/projects/update_service_spec.rb
+5
-5
No files found.
.rubocop_todo.yml
View file @
7de4b36f
...
@@ -829,10 +829,6 @@ Rails/SaveBang:
...
@@ -829,10 +829,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'
...
...
changelogs/unreleased/rails-save-bang-25.yml
0 → 100644
View file @
7de4b36f
---
title
:
Fix Rails/SaveBang offenses for ee/spec/services/projects/*
merge_request
:
41332
author
:
Rajendra Kadam
type
:
fixed
ee/spec/services/projects/after_rename_service_spec.rb
View file @
7de4b36f
...
@@ -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
...
...
ee/spec/services/projects/import_export/export_service_spec.rb
View file @
7de4b36f
...
@@ -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
...
...
ee/spec/services/projects/update_mirror_service_spec.rb
View file @
7de4b36f
...
@@ -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
...
...
ee/spec/services/projects/update_service_spec.rb
View file @
7de4b36f
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment