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
4aaa15fa
Commit
4aaa15fa
authored
Jul 17, 2020
by
Rajendra Kadam
Committed by
Peter Leitzen
Jul 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Rails/SaveBang RuboCop offenses for projects controllers
parent
46106642
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
22 additions
and
24 deletions
+22
-24
.rubocop_todo.yml
.rubocop_todo.yml
+0
-7
changelogs/unreleased/rails-save-bang-3.yml
changelogs/unreleased/rails-save-bang-3.yml
+5
-0
ee/spec/controllers/projects/environments_controller_spec.rb
ee/spec/controllers/projects/environments_controller_spec.rb
+1
-1
ee/spec/controllers/projects/issues_controller_spec.rb
ee/spec/controllers/projects/issues_controller_spec.rb
+1
-1
ee/spec/controllers/projects/merge_requests/creations_controller_spec.rb
...lers/projects/merge_requests/creations_controller_spec.rb
+4
-4
ee/spec/controllers/projects/merge_requests_controller_spec.rb
...ec/controllers/projects/merge_requests_controller_spec.rb
+5
-5
ee/spec/controllers/projects/project_members_controller_spec.rb
...c/controllers/projects/project_members_controller_spec.rb
+3
-3
ee/spec/controllers/projects/subscriptions_controller_spec.rb
...pec/controllers/projects/subscriptions_controller_spec.rb
+2
-2
ee/spec/controllers/projects/vulnerability_feedback_controller_spec.rb
...ollers/projects/vulnerability_feedback_controller_spec.rb
+1
-1
No files found.
.rubocop_todo.yml
View file @
4aaa15fa
...
@@ -853,14 +853,7 @@ Style/SymbolProc:
...
@@ -853,14 +853,7 @@ Style/SymbolProc:
# Configuration parameters: AllowImplicitReturn, AllowedReceivers.
# Configuration parameters: AllowImplicitReturn, AllowedReceivers.
Rails/SaveBang
:
Rails/SaveBang
:
Exclude
:
Exclude
:
-
'
ee/spec/controllers/projects/environments_controller_spec.rb'
-
'
ee/spec/controllers/projects/issues_controller_spec.rb'
-
'
ee/spec/controllers/projects/merge_requests/creations_controller_spec.rb'
-
'
ee/spec/controllers/projects/merge_requests_controller_spec.rb'
-
'
ee/spec/controllers/projects/merge_requests_controller_spec.rb'
-
'
ee/spec/controllers/projects/project_members_controller_spec.rb'
-
'
ee/spec/controllers/projects/service_desk_controller_spec.rb'
-
'
ee/spec/controllers/projects/subscriptions_controller_spec.rb'
-
'
ee/spec/controllers/projects/vulnerability_feedback_controller_spec.rb'
-
'
ee/spec/controllers/subscriptions_controller_spec.rb'
-
'
ee/spec/controllers/subscriptions_controller_spec.rb'
-
'
ee/spec/factories/ci/job_artifacts.rb'
-
'
ee/spec/factories/ci/job_artifacts.rb'
-
'
ee/spec/factories/epics.rb'
-
'
ee/spec/factories/epics.rb'
...
...
changelogs/unreleased/rails-save-bang-3.yml
0 → 100644
View file @
4aaa15fa
---
title
:
Refactor projects controllers specs to fix SaveBang Cop
merge_request
:
36920
author
:
Rajendra Kadam
type
:
fixed
ee/spec/controllers/projects/environments_controller_spec.rb
View file @
4aaa15fa
...
@@ -99,7 +99,7 @@ RSpec.describe Projects::EnvironmentsController do
...
@@ -99,7 +99,7 @@ RSpec.describe Projects::EnvironmentsController do
context
'when user has access to it'
do
context
'when user has access to it'
do
before
do
before
do
protected_environment
.
deploy_access_levels
.
create
(
user:
user
)
protected_environment
.
deploy_access_levels
.
create
!
(
user:
user
)
get
:terminal
,
params:
environment_params
get
:terminal
,
params:
environment_params
end
end
...
...
ee/spec/controllers/projects/issues_controller_spec.rb
View file @
4aaa15fa
...
@@ -184,7 +184,7 @@ RSpec.describe Projects::IssuesController do
...
@@ -184,7 +184,7 @@ RSpec.describe Projects::IssuesController do
before
do
before
do
sign_in
(
user
)
sign_in
(
user
)
allow
(
Gitlab
).
to
receive
(
:com?
).
and_return
(
true
)
allow
(
Gitlab
).
to
receive
(
:com?
).
and_return
(
true
)
discussion
.
update
(
author:
user
)
discussion
.
update
!
(
author:
user
)
end
end
shared_context
'non inclusion of gitlab team member badge'
do
|
result
|
shared_context
'non inclusion of gitlab team member badge'
do
|
result
|
...
...
ee/spec/controllers/projects/merge_requests/creations_controller_spec.rb
View file @
4aaa15fa
...
@@ -32,7 +32,7 @@ RSpec.describe Projects::MergeRequests::CreationsController do
...
@@ -32,7 +32,7 @@ RSpec.describe Projects::MergeRequests::CreationsController do
context
'the approvals_before_merge param'
do
context
'the approvals_before_merge param'
do
before
do
before
do
project
.
update
(
approvals_before_merge:
2
)
project
.
update
!
(
approvals_before_merge:
2
)
end
end
context
'when it is less than the one in the target project'
do
context
'when it is less than the one in the target project'
do
...
@@ -83,8 +83,8 @@ RSpec.describe Projects::MergeRequests::CreationsController do
...
@@ -83,8 +83,8 @@ RSpec.describe Projects::MergeRequests::CreationsController do
context
'when the target project is a fork of a deleted project'
do
context
'when the target project is a fork of a deleted project'
do
before
do
before
do
original_project
=
create
(
:project
)
original_project
=
create
(
:project
)
project
.
update
(
forked_from_project:
original_project
,
approvals_before_merge:
4
)
project
.
update
!
(
forked_from_project:
original_project
,
approvals_before_merge:
4
)
original_project
.
update
(
pending_delete:
true
)
original_project
.
update
!
(
pending_delete:
true
)
create_merge_request
(
approvals_before_merge:
3
)
create_merge_request
(
approvals_before_merge:
3
)
end
end
...
@@ -105,7 +105,7 @@ RSpec.describe Projects::MergeRequests::CreationsController do
...
@@ -105,7 +105,7 @@ RSpec.describe Projects::MergeRequests::CreationsController do
before
do
before
do
project
.
add_developer
(
new_approver
)
project
.
add_developer
(
new_approver
)
project
.
update
(
disable_overriding_approvers_per_merge_request:
disable_overriding_approvers_per_merge_request
)
project
.
update
!
(
disable_overriding_approvers_per_merge_request:
disable_overriding_approvers_per_merge_request
)
create_merge_request
(
create_merge_request
(
approval_rules_attributes:
[
approval_rules_attributes:
[
...
...
ee/spec/controllers/projects/merge_requests_controller_spec.rb
View file @
4aaa15fa
...
@@ -144,7 +144,7 @@ RSpec.describe Projects::MergeRequestsController do
...
@@ -144,7 +144,7 @@ RSpec.describe Projects::MergeRequestsController do
context
'when the merge request requires approval'
do
context
'when the merge request requires approval'
do
before
do
before
do
project
.
update
(
approvals_before_merge:
1
)
project
.
update
!
(
approvals_before_merge:
1
)
end
end
it_behaves_like
'update invalid issuable'
,
MergeRequest
it_behaves_like
'update invalid issuable'
,
MergeRequest
...
@@ -152,12 +152,12 @@ RSpec.describe Projects::MergeRequestsController do
...
@@ -152,12 +152,12 @@ RSpec.describe Projects::MergeRequestsController do
context
'overriding approvers per MR'
do
context
'overriding approvers per MR'
do
before
do
before
do
project
.
update
(
approvals_before_merge:
1
)
project
.
update
!
(
approvals_before_merge:
1
)
end
end
context
'enabled'
do
context
'enabled'
do
before
do
before
do
project
.
update
(
disable_overriding_approvers_per_merge_request:
false
)
project
.
update
!
(
disable_overriding_approvers_per_merge_request:
false
)
end
end
it
'updates approvals'
do
it
'updates approvals'
do
...
@@ -195,7 +195,7 @@ RSpec.describe Projects::MergeRequestsController do
...
@@ -195,7 +195,7 @@ RSpec.describe Projects::MergeRequestsController do
before
do
before
do
project
.
add_developer
(
new_approver
)
project
.
add_developer
(
new_approver
)
project
.
update
(
disable_overriding_approvers_per_merge_request:
true
)
project
.
update
!
(
disable_overriding_approvers_per_merge_request:
true
)
end
end
it
'does not update approvals_before_merge'
do
it
'does not update approvals_before_merge'
do
...
@@ -364,7 +364,7 @@ RSpec.describe Projects::MergeRequestsController do
...
@@ -364,7 +364,7 @@ RSpec.describe Projects::MergeRequestsController do
before
do
before
do
upstream
.
add_developer
(
user
)
upstream
.
add_developer
(
user
)
upstream
.
update
(
approvals_before_merge:
2
)
upstream
.
update
!
(
approvals_before_merge:
2
)
end
end
it_behaves_like
'approvals_before_merge param'
it_behaves_like
'approvals_before_merge param'
...
...
ee/spec/controllers/projects/project_members_controller_spec.rb
View file @
4aaa15fa
...
@@ -32,7 +32,7 @@ RSpec.describe Projects::ProjectMembersController do
...
@@ -32,7 +32,7 @@ RSpec.describe Projects::ProjectMembersController do
context
'and the project group has membership lock enabled'
do
context
'and the project group has membership lock enabled'
do
before
do
before
do
project
.
namespace
.
update
(
membership_lock:
true
)
project
.
namespace
.
update
!
(
membership_lock:
true
)
end
end
it
'responds with 403'
do
it
'responds with 403'
do
...
@@ -64,7 +64,7 @@ RSpec.describe Projects::ProjectMembersController do
...
@@ -64,7 +64,7 @@ RSpec.describe Projects::ProjectMembersController do
context
'when project group has membership lock enabled'
do
context
'when project group has membership lock enabled'
do
before
do
before
do
project
.
namespace
.
update
(
membership_lock:
true
)
project
.
namespace
.
update
!
(
membership_lock:
true
)
end
end
it
'responds with 403'
do
it
'responds with 403'
do
...
@@ -90,7 +90,7 @@ RSpec.describe Projects::ProjectMembersController do
...
@@ -90,7 +90,7 @@ RSpec.describe Projects::ProjectMembersController do
context
'when project group has membership lock enabled'
do
context
'when project group has membership lock enabled'
do
before
do
before
do
project
.
namespace
.
update
(
membership_lock:
true
)
project
.
namespace
.
update
!
(
membership_lock:
true
)
end
end
it
'responds with 403'
do
it
'responds with 403'
do
...
...
ee/spec/controllers/projects/subscriptions_controller_spec.rb
View file @
4aaa15fa
...
@@ -18,7 +18,7 @@ RSpec.describe Projects::SubscriptionsController do
...
@@ -18,7 +18,7 @@ RSpec.describe Projects::SubscriptionsController do
before
do
before
do
plan_limits
=
create
(
:plan_limits
,
:default_plan
)
plan_limits
=
create
(
:plan_limits
,
:default_plan
)
plan_limits
.
update
(
ci_project_subscriptions:
2
)
plan_limits
.
update
!
(
ci_project_subscriptions:
2
)
end
end
context
'when user is authorized'
do
context
'when user is authorized'
do
...
@@ -80,7 +80,7 @@ RSpec.describe Projects::SubscriptionsController do
...
@@ -80,7 +80,7 @@ RSpec.describe Projects::SubscriptionsController do
context
'when project is not public'
do
context
'when project is not public'
do
before
do
before
do
upstream_project
.
update
(
visibility_level:
Gitlab
::
VisibilityLevel
::
PRIVATE
)
upstream_project
.
update
!
(
visibility_level:
Gitlab
::
VisibilityLevel
::
PRIVATE
)
end
end
it
'does not create a new subscription'
do
it
'does not create a new subscription'
do
...
...
ee/spec/controllers/projects/vulnerability_feedback_controller_spec.rb
View file @
4aaa15fa
...
@@ -52,7 +52,7 @@ RSpec.describe Projects::VulnerabilityFeedbackController do
...
@@ -52,7 +52,7 @@ RSpec.describe Projects::VulnerabilityFeedbackController do
pipeline:
create
(
:ci_pipeline
)
pipeline:
create
(
:ci_pipeline
)
)
)
feedback
.
save
(
validate:
false
)
feedback
.
save
!
(
validate:
false
)
end
end
it
'ignores feedback in other project'
do
it
'ignores feedback in other project'
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