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
c45fe83d
Commit
c45fe83d
authored
May 18, 2021
by
Suraj Tripathi
Committed by
Dylan Griffith
May 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed SaveBangs in /ee/spec/models/ee/*
parent
8f84338e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
17 additions
and
17 deletions
+17
-17
.rubocop_manual_todo.yml
.rubocop_manual_todo.yml
+0
-5
ee/changelogs/unreleased/issue-220040-fix-robocop-savebang-ee-models-ee.yml
...leased/issue-220040-fix-robocop-savebang-ee-models-ee.yml
+5
-0
ee/spec/models/ee/appearance_spec.rb
ee/spec/models/ee/appearance_spec.rb
+1
-1
ee/spec/models/ee/ci/job_artifact_spec.rb
ee/spec/models/ee/ci/job_artifact_spec.rb
+2
-2
ee/spec/models/ee/protected_branch_spec.rb
ee/spec/models/ee/protected_branch_spec.rb
+4
-4
ee/spec/models/ee/protected_ref_access_spec.rb
ee/spec/models/ee/protected_ref_access_spec.rb
+3
-3
ee/spec/models/ee/protected_ref_spec.rb
ee/spec/models/ee/protected_ref_spec.rb
+2
-2
No files found.
.rubocop_manual_todo.yml
View file @
c45fe83d
...
@@ -52,11 +52,6 @@ Rails/SaveBang:
...
@@ -52,11 +52,6 @@ Rails/SaveBang:
-
'
ee/spec/models/approval_merge_request_rule_spec.rb'
-
'
ee/spec/models/approval_merge_request_rule_spec.rb'
-
'
ee/spec/models/approval_project_rule_spec.rb'
-
'
ee/spec/models/approval_project_rule_spec.rb'
-
'
ee/spec/models/burndown_spec.rb'
-
'
ee/spec/models/burndown_spec.rb'
-
'
ee/spec/models/ee/appearance_spec.rb'
-
'
ee/spec/models/ee/ci/job_artifact_spec.rb'
-
'
ee/spec/models/ee/protected_branch_spec.rb'
-
'
ee/spec/models/ee/protected_ref_access_spec.rb'
-
'
ee/spec/models/ee/protected_ref_spec.rb'
-
'
ee/spec/models/elasticsearch_indexed_namespace_spec.rb'
-
'
ee/spec/models/elasticsearch_indexed_namespace_spec.rb'
-
'
ee/spec/models/environment_spec.rb'
-
'
ee/spec/models/environment_spec.rb'
-
'
ee/spec/models/epic_spec.rb'
-
'
ee/spec/models/epic_spec.rb'
...
...
ee/changelogs/unreleased/issue-220040-fix-robocop-savebang-ee-models-ee.yml
0 → 100644
View file @
c45fe83d
---
title
:
Fix Rails/SaveBang Rubocop offenses for ee models
merge_request
:
61709
author
:
Suraj Tripathi @surajtripathy07
type
:
fixed
ee/spec/models/ee/appearance_spec.rb
View file @
c45fe83d
...
@@ -53,7 +53,7 @@ RSpec.describe Appearance do
...
@@ -53,7 +53,7 @@ RSpec.describe Appearance do
appearance
=
create
(
:appearance
,
:with_header_logo
,
:with_logo
)
appearance
=
create
(
:appearance
,
:with_header_logo
,
:with_logo
)
expect
do
expect
do
appearance
.
update
(
header_logo:
fixture_file_upload
(
'spec/fixtures/rails_sample.jpg'
))
appearance
.
update
!
(
header_logo:
fixture_file_upload
(
'spec/fixtures/rails_sample.jpg'
))
end
.
to
change
(
Geo
::
UploadDeletedEvent
,
:count
).
by
(
1
)
end
.
to
change
(
Geo
::
UploadDeletedEvent
,
:count
).
by
(
1
)
end
end
end
end
...
...
ee/spec/models/ee/ci/job_artifact_spec.rb
View file @
c45fe83d
...
@@ -18,7 +18,7 @@ RSpec.describe Ci::JobArtifact do
...
@@ -18,7 +18,7 @@ RSpec.describe Ci::JobArtifact do
job_artifact
=
create
(
:ee_ci_job_artifact
,
:archive
)
job_artifact
=
create
(
:ee_ci_job_artifact
,
:archive
)
expect
do
expect
do
job_artifact
.
destroy
job_artifact
.
destroy
!
end
.
to
change
{
Geo
::
JobArtifactDeletedEvent
.
count
}.
by
(
1
)
end
.
to
change
{
Geo
::
JobArtifactDeletedEvent
.
count
}.
by
(
1
)
end
end
end
end
...
@@ -174,7 +174,7 @@ RSpec.describe Ci::JobArtifact do
...
@@ -174,7 +174,7 @@ RSpec.describe Ci::JobArtifact do
with_them
do
with_them
do
subject
(
:job_artifact_included
)
{
described_class
.
replicables_for_current_secondary
(
ci_job_artifact
).
exists?
}
subject
(
:job_artifact_included
)
{
described_class
.
replicables_for_current_secondary
(
ci_job_artifact
).
exists?
}
let
(
:project
)
{
create
(
*
project_factory
)
}
let
(
:project
)
{
create
(
*
project_factory
)
}
# rubocop:disable Rails/SaveBang
let
(
:ci_build
)
{
create
(
:ci_build
,
project:
project
)
}
let
(
:ci_build
)
{
create
(
:ci_build
,
project:
project
)
}
let
(
:node
)
do
let
(
:node
)
do
create
(
:geo_node_with_selective_sync_for
,
create
(
:geo_node_with_selective_sync_for
,
...
...
ee/spec/models/ee/protected_branch_spec.rb
View file @
c45fe83d
...
@@ -47,7 +47,7 @@ RSpec.describe ProtectedBranch do
...
@@ -47,7 +47,7 @@ RSpec.describe ProtectedBranch do
it
"does not count a group-based
#{
human_association_name
}
with an `access_level` set"
do
it
"does not count a group-based
#{
human_association_name
}
with an `access_level` set"
do
group
=
create
(
:group
)
group
=
create
(
:group
)
protected_branch
=
create
(
:protected_branch
,
default_access_level:
false
)
protected_branch
=
create
(
:protected_branch
,
default_access_level:
false
)
protected_branch
.
project
.
project_group_links
.
create
(
group:
group
)
protected_branch
.
project
.
project_group_links
.
create
!
(
group:
group
)
protected_branch
.
send
(
association_name
)
<<
build
(
factory_name
,
group:
group
,
access_level:
Gitlab
::
Access
::
MAINTAINER
)
protected_branch
.
send
(
association_name
)
<<
build
(
factory_name
,
group:
group
,
access_level:
Gitlab
::
Access
::
MAINTAINER
)
protected_branch
.
send
(
association_name
)
<<
build
(
factory_name
,
access_level:
Gitlab
::
Access
::
MAINTAINER
)
protected_branch
.
send
(
association_name
)
<<
build
(
factory_name
,
access_level:
Gitlab
::
Access
::
MAINTAINER
)
...
@@ -93,8 +93,8 @@ RSpec.describe ProtectedBranch do
...
@@ -93,8 +93,8 @@ RSpec.describe ProtectedBranch do
first_protected_branch
=
create
(
:protected_branch
,
default_access_level:
false
)
first_protected_branch
=
create
(
:protected_branch
,
default_access_level:
false
)
second_protected_branch
=
create
(
:protected_branch
,
default_access_level:
false
)
second_protected_branch
=
create
(
:protected_branch
,
default_access_level:
false
)
first_protected_branch
.
project
.
project_group_links
.
create
(
group:
group
)
first_protected_branch
.
project
.
project_group_links
.
create
!
(
group:
group
)
second_protected_branch
.
project
.
project_group_links
.
create
(
group:
group
)
second_protected_branch
.
project
.
project_group_links
.
create
!
(
group:
group
)
first_protected_branch
.
send
(
association_name
)
<<
build
(
factory_name
,
group:
group
)
first_protected_branch
.
send
(
association_name
)
<<
build
(
factory_name
,
group:
group
)
second_protected_branch
.
send
(
association_name
)
<<
build
(
factory_name
,
group:
group
)
second_protected_branch
.
send
(
association_name
)
<<
build
(
factory_name
,
group:
group
)
...
@@ -109,7 +109,7 @@ RSpec.describe ProtectedBranch do
...
@@ -109,7 +109,7 @@ RSpec.describe ProtectedBranch do
it
"ignores the `access_level` while validating a group-based
#{
human_association_name
}
"
do
it
"ignores the `access_level` while validating a group-based
#{
human_association_name
}
"
do
protected_branch
=
create
(
:protected_branch
,
default_access_level:
false
)
protected_branch
=
create
(
:protected_branch
,
default_access_level:
false
)
protected_branch
.
project
.
project_group_links
.
create
(
group:
group
)
protected_branch
.
project
.
project_group_links
.
create
!
(
group:
group
)
protected_branch
.
send
(
association_name
)
<<
build
(
factory_name
,
access_level:
Gitlab
::
Access
::
MAINTAINER
)
protected_branch
.
send
(
association_name
)
<<
build
(
factory_name
,
access_level:
Gitlab
::
Access
::
MAINTAINER
)
protected_branch
.
send
(
association_name
)
<<
build
(
factory_name
,
group:
group
,
access_level:
Gitlab
::
Access
::
MAINTAINER
)
protected_branch
.
send
(
association_name
)
<<
build
(
factory_name
,
group:
group
,
access_level:
Gitlab
::
Access
::
MAINTAINER
)
...
...
ee/spec/models/ee/protected_ref_access_spec.rb
View file @
c45fe83d
...
@@ -17,7 +17,7 @@ RSpec.describe EE::ProtectedRefAccess do
...
@@ -17,7 +17,7 @@ RSpec.describe EE::ProtectedRefAccess do
before
do
before
do
project
.
add_developer
(
user
)
project
.
add_developer
(
user
)
project
.
project_group_links
.
create
(
group:
group
)
project
.
project_group_links
.
create
!
(
group:
group
)
end
end
it
"
#{
included_in_class
}
includes {described_class}"
do
it
"
#{
included_in_class
}
includes {described_class}"
do
...
@@ -104,8 +104,8 @@ RSpec.describe EE::ProtectedRefAccess do
...
@@ -104,8 +104,8 @@ RSpec.describe EE::ProtectedRefAccess do
it
"doesn't require access_level if group specified"
do
it
"doesn't require access_level if group specified"
do
subject
=
build
(
factory_name
,
access_level:
nil
,
group:
create
(
:group
))
subject
=
build
(
factory_name
,
access_level:
nil
,
group:
create
(
:group
))
subject
.
project
.
save
subject
.
project
.
save
!
subject
.
project
.
project_group_links
.
create
(
group:
subject
.
group
)
subject
.
project
.
project_group_links
.
create
!
(
group:
subject
.
group
)
expect
(
subject
).
to
be_valid
expect
(
subject
).
to
be_valid
end
end
...
...
ee/spec/models/ee/protected_ref_spec.rb
View file @
c45fe83d
...
@@ -9,7 +9,7 @@ RSpec.describe EE::ProtectedRef do
...
@@ -9,7 +9,7 @@ RSpec.describe EE::ProtectedRef do
2
.
times
do
2
.
times
do
group
=
create
(
:group
)
group
=
create
(
:group
)
protected_branch
.
project
.
project_group_links
.
create
(
group:
group
)
protected_branch
.
project
.
project_group_links
.
create
!
(
group:
group
)
protected_branch
.
merge_access_levels
.
create!
(
group:
group
)
protected_branch
.
merge_access_levels
.
create!
(
group:
group
)
end
end
...
@@ -19,7 +19,7 @@ RSpec.describe EE::ProtectedRef do
...
@@ -19,7 +19,7 @@ RSpec.describe EE::ProtectedRef do
protected_branch
.
push_access_levels
.
create!
(
user:
user
)
protected_branch
.
push_access_levels
.
create!
(
user:
user
)
end
end
protected_branch
.
destroy
protected_branch
.
destroy
!
expect
(
ProtectedBranch
::
MergeAccessLevel
.
count
).
to
be
(
0
)
expect
(
ProtectedBranch
::
MergeAccessLevel
.
count
).
to
be
(
0
)
expect
(
ProtectedBranch
::
PushAccessLevel
.
count
).
to
be
(
0
)
expect
(
ProtectedBranch
::
PushAccessLevel
.
count
).
to
be
(
0
)
...
...
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