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
8bb75dff
Commit
8bb75dff
authored
Oct 12, 2020
by
Matthew Briedenhann
Committed by
Peter Leitzen
Oct 12, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Rails/SaveBang offenses
Fixed in spec/support/*
parent
45dcd491
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
16 additions
and
16 deletions
+16
-16
.rubocop_todo.yml
.rubocop_todo.yml
+0
-5
changelogs/unreleased/mb_rails_save_bang_fix3.yml
changelogs/unreleased/mb_rails_save_bang_fix3.yml
+5
-0
spec/support/migrations_helpers/cluster_helpers.rb
spec/support/migrations_helpers/cluster_helpers.rb
+5
-5
spec/support/migrations_helpers/namespaces_helper.rb
spec/support/migrations_helpers/namespaces_helper.rb
+1
-1
spec/support/shared_contexts/email_shared_context.rb
spec/support/shared_contexts/email_shared_context.rb
+1
-1
spec/support/shared_contexts/finders/group_projects_finder_shared_contexts.rb
...contexts/finders/group_projects_finder_shared_contexts.rb
+3
-3
spec/support/shared_contexts/mailers/notify_shared_context.rb
.../support/shared_contexts/mailers/notify_shared_context.rb
+1
-1
No files found.
.rubocop_todo.yml
View file @
8bb75dff
...
@@ -1165,11 +1165,6 @@ Rails/SaveBang:
...
@@ -1165,11 +1165,6 @@ Rails/SaveBang:
-
'
spec/services/users/repair_ldap_blocked_service_spec.rb'
-
'
spec/services/users/repair_ldap_blocked_service_spec.rb'
-
'
spec/services/verify_pages_domain_service_spec.rb'
-
'
spec/services/verify_pages_domain_service_spec.rb'
-
'
spec/sidekiq/cron/job_gem_dependency_spec.rb'
-
'
spec/sidekiq/cron/job_gem_dependency_spec.rb'
-
'
spec/support/migrations_helpers/cluster_helpers.rb'
-
'
spec/support/migrations_helpers/namespaces_helper.rb'
-
'
spec/support/shared_contexts/email_shared_context.rb'
-
'
spec/support/shared_contexts/finders/group_projects_finder_shared_contexts.rb'
-
'
spec/support/shared_contexts/mailers/notify_shared_context.rb'
# Offense count: 187
# Offense count: 187
# Cop supports --auto-correct.
# Cop supports --auto-correct.
...
...
changelogs/unreleased/mb_rails_save_bang_fix3.yml
0 → 100644
View file @
8bb75dff
---
title
:
Fix Rails/SaveBang offenses in spec/support/*
merge_request
:
44884
author
:
matthewbried
type
:
other
spec/support/migrations_helpers/cluster_helpers.rb
View file @
8bb75dff
...
@@ -4,7 +4,7 @@ module MigrationHelpers
...
@@ -4,7 +4,7 @@ module MigrationHelpers
module
ClusterHelpers
module
ClusterHelpers
# Creates a list of cluster projects.
# Creates a list of cluster projects.
def
create_cluster_project_list
(
quantity
)
def
create_cluster_project_list
(
quantity
)
group
=
namespaces_table
.
create
(
name:
'gitlab-org'
,
path:
'gitlab-org'
)
group
=
namespaces_table
.
create
!
(
name:
'gitlab-org'
,
path:
'gitlab-org'
)
quantity
.
times
do
|
id
|
quantity
.
times
do
|
id
|
create_cluster_project
(
group
,
id
)
create_cluster_project
(
group
,
id
)
...
@@ -25,14 +25,14 @@ module MigrationHelpers
...
@@ -25,14 +25,14 @@ module MigrationHelpers
namespace_id:
group
.
id
namespace_id:
group
.
id
)
)
cluster
=
clusters_table
.
create
(
cluster
=
clusters_table
.
create
!
(
name:
'test-cluster'
,
name:
'test-cluster'
,
cluster_type:
3
,
cluster_type:
3
,
provider_type: :gcp
,
provider_type: :gcp
,
platform_type: :kubernetes
platform_type: :kubernetes
)
)
cluster_projects_table
.
create
(
project_id:
project
.
id
,
cluster_id:
cluster
.
id
)
cluster_projects_table
.
create
!
(
project_id:
project
.
id
,
cluster_id:
cluster
.
id
)
provider_gcp_table
.
create!
(
provider_gcp_table
.
create!
(
gcp_project_id:
"test-gcp-project-
#{
id
}
"
,
gcp_project_id:
"test-gcp-project-
#{
id
}
"
,
...
@@ -43,7 +43,7 @@ module MigrationHelpers
...
@@ -43,7 +43,7 @@ module MigrationHelpers
zone:
'us-central1-a'
zone:
'us-central1-a'
)
)
platform_kubernetes_table
.
create
(
platform_kubernetes_table
.
create
!
(
cluster_id:
cluster
.
id
,
cluster_id:
cluster
.
id
,
api_url:
'https://kubernetes.example.com'
,
api_url:
'https://kubernetes.example.com'
,
encrypted_token:
'a'
*
40
,
encrypted_token:
'a'
*
40
,
...
@@ -58,7 +58,7 @@ module MigrationHelpers
...
@@ -58,7 +58,7 @@ module MigrationHelpers
project
=
projects_table
.
find
(
cluster_project
.
project_id
)
project
=
projects_table
.
find
(
cluster_project
.
project_id
)
namespace
=
"
#{
project
.
path
}
-
#{
project
.
id
}
"
namespace
=
"
#{
project
.
path
}
-
#{
project
.
id
}
"
cluster_kubernetes_namespaces_table
.
create
(
cluster_kubernetes_namespaces_table
.
create
!
(
cluster_project_id:
cluster_project
.
id
,
cluster_project_id:
cluster_project
.
id
,
cluster_id:
cluster
.
id
,
cluster_id:
cluster
.
id
,
project_id:
cluster_project
.
project_id
,
project_id:
cluster_project
.
project_id
,
...
...
spec/support/migrations_helpers/namespaces_helper.rb
View file @
8bb75dff
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
module
MigrationHelpers
module
MigrationHelpers
module
NamespacesHelpers
module
NamespacesHelpers
def
create_namespace
(
name
,
visibility
,
options
=
{})
def
create_namespace
(
name
,
visibility
,
options
=
{})
table
(
:namespaces
).
create
({
table
(
:namespaces
).
create
!
({
name:
name
,
name:
name
,
path:
name
,
path:
name
,
type:
'Group'
,
type:
'Group'
,
...
...
spec/support/shared_contexts/email_shared_context.rb
View file @
8bb75dff
...
@@ -21,7 +21,7 @@ end
...
@@ -21,7 +21,7 @@ end
RSpec
.
shared_examples
:reply_processing_shared_examples
do
RSpec
.
shared_examples
:reply_processing_shared_examples
do
context
"when the user could not be found"
do
context
"when the user could not be found"
do
before
do
before
do
user
.
destroy
user
.
destroy
!
end
end
it
"raises a UserNotFoundError"
do
it
"raises a UserNotFoundError"
do
...
...
spec/support/shared_contexts/finders/group_projects_finder_shared_contexts.rb
View file @
8bb75dff
...
@@ -18,8 +18,8 @@ RSpec.shared_context 'GroupProjectsFinder context' do
...
@@ -18,8 +18,8 @@ RSpec.shared_context 'GroupProjectsFinder context' do
let!
(
:subgroup_private_project
)
{
create
(
:project
,
:private
,
path:
'7'
,
group:
subgroup
)
}
let!
(
:subgroup_private_project
)
{
create
(
:project
,
:private
,
path:
'7'
,
group:
subgroup
)
}
before
do
before
do
shared_project_1
.
project_group_links
.
create
(
group_access:
Gitlab
::
Access
::
MAINTAINER
,
group:
group
)
shared_project_1
.
project_group_links
.
create
!
(
group_access:
Gitlab
::
Access
::
MAINTAINER
,
group:
group
)
shared_project_2
.
project_group_links
.
create
(
group_access:
Gitlab
::
Access
::
MAINTAINER
,
group:
group
)
shared_project_2
.
project_group_links
.
create
!
(
group_access:
Gitlab
::
Access
::
MAINTAINER
,
group:
group
)
shared_project_3
.
project_group_links
.
create
(
group_access:
Gitlab
::
Access
::
MAINTAINER
,
group:
group
)
shared_project_3
.
project_group_links
.
create
!
(
group_access:
Gitlab
::
Access
::
MAINTAINER
,
group:
group
)
end
end
end
end
spec/support/shared_contexts/mailers/notify_shared_context.rb
View file @
8bb75dff
...
@@ -11,7 +11,7 @@ RSpec.shared_context 'gitlab email notification' do
...
@@ -11,7 +11,7 @@ RSpec.shared_context 'gitlab email notification' do
let
(
:new_user_address
)
{
'newguy@example.com'
}
let
(
:new_user_address
)
{
'newguy@example.com'
}
before
do
before
do
email
=
recipient
.
emails
.
create
(
email:
"notifications@example.com"
)
email
=
recipient
.
emails
.
create
!
(
email:
"notifications@example.com"
)
recipient
.
update_attribute
(
:notification_email
,
email
.
email
)
recipient
.
update_attribute
(
:notification_email
,
email
.
email
)
stub_incoming_email_setting
(
enabled:
true
,
address:
"reply+%{key}@
#{
Gitlab
.
config
.
gitlab
.
host
}
"
)
stub_incoming_email_setting
(
enabled:
true
,
address:
"reply+%{key}@
#{
Gitlab
.
config
.
gitlab
.
host
}
"
)
end
end
...
...
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