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
cfce6cb3
Commit
cfce6cb3
authored
Jul 14, 2020
by
Rajendra Kadam
Committed by
Peter Leitzen
Jul 14, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Rails/SaveBang RuboCop offenses for groups controllers
parent
1e00a38d
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
17 additions
and
18 deletions
+17
-18
.rubocop_todo.yml
.rubocop_todo.yml
+0
-6
changelogs/unreleased/rails-save-bang-2.yml
changelogs/unreleased/rails-save-bang-2.yml
+5
-0
ee/spec/controllers/ee/sent_notifications_controller_spec.rb
ee/spec/controllers/ee/sent_notifications_controller_spec.rb
+1
-1
ee/spec/controllers/groups/epic_issues_controller_spec.rb
ee/spec/controllers/groups/epic_issues_controller_spec.rb
+1
-1
ee/spec/controllers/groups/epic_links_controller_spec.rb
ee/spec/controllers/groups/epic_links_controller_spec.rb
+5
-5
ee/spec/controllers/groups/epics_controller_spec.rb
ee/spec/controllers/groups/epics_controller_spec.rb
+1
-1
ee/spec/controllers/groups/roadmap_controller_spec.rb
ee/spec/controllers/groups/roadmap_controller_spec.rb
+2
-2
ee/spec/controllers/groups/sso_controller_spec.rb
ee/spec/controllers/groups/sso_controller_spec.rb
+2
-2
No files found.
.rubocop_todo.yml
View file @
cfce6cb3
...
...
@@ -743,12 +743,6 @@ Style/SymbolProc:
# Configuration parameters: AllowImplicitReturn, AllowedReceivers.
Rails/SaveBang
:
Exclude
:
-
'
ee/spec/controllers/ee/sent_notifications_controller_spec.rb'
-
'
ee/spec/controllers/groups/epic_issues_controller_spec.rb'
-
'
ee/spec/controllers/groups/epic_links_controller_spec.rb'
-
'
ee/spec/controllers/groups/epics_controller_spec.rb'
-
'
ee/spec/controllers/groups/roadmap_controller_spec.rb'
-
'
ee/spec/controllers/groups/sso_controller_spec.rb'
-
'
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'
...
...
changelogs/unreleased/rails-save-bang-2.yml
0 → 100644
View file @
cfce6cb3
---
title
:
Refactor group controllers specs to fix SaveBang Cop
merge_request
:
36853
author
:
Rajendra Kadam
type
:
fixed
ee/spec/controllers/ee/sent_notifications_controller_spec.rb
View file @
cfce6cb3
...
...
@@ -8,7 +8,7 @@ RSpec.describe SentNotificationsController do
context
'Unsubscribing from an epic'
do
let
(
:epic
)
do
create
(
:epic
,
author:
user
)
do
|
epic
|
epic
.
subscriptions
.
create
(
user:
user
,
project:
nil
,
subscribed:
true
)
epic
.
subscriptions
.
create
!
(
user:
user
,
project:
nil
,
subscribed:
true
)
end
end
let
(
:sent_notification
)
{
create
(
:sent_notification
,
project:
nil
,
noteable:
epic
,
recipient:
user
)
}
...
...
ee/spec/controllers/groups/epic_issues_controller_spec.rb
View file @
cfce6cb3
...
...
@@ -55,7 +55,7 @@ RSpec.describe Groups::EpicIssuesController do
context
'when user does not have access to epic'
do
it
'returns 404 status'
do
group
.
update
(
visibility_level:
Gitlab
::
VisibilityLevel
::
PRIVATE
)
group
.
update
!
(
visibility_level:
Gitlab
::
VisibilityLevel
::
PRIVATE
)
subject
...
...
ee/spec/controllers/groups/epic_links_controller_spec.rb
View file @
cfce6cb3
...
...
@@ -31,7 +31,7 @@ RSpec.describe Groups::EpicLinksController do
let
(
:features_when_forbidden
)
{
{
epics:
false
}
}
before
do
epic1
.
update
(
parent:
parent_epic
)
epic1
.
update
!
(
parent:
parent_epic
)
end
subject
{
get
:index
,
params:
{
group_id:
group
,
epic_id:
parent_epic
.
to_param
}
}
...
...
@@ -60,7 +60,7 @@ RSpec.describe Groups::EpicLinksController do
context
'when user does not have access to epic'
do
it
'returns 404 status'
do
group
.
update
(
visibility_level:
Gitlab
::
VisibilityLevel
::
PRIVATE
)
group
.
update
!
(
visibility_level:
Gitlab
::
VisibilityLevel
::
PRIVATE
)
subject
...
...
@@ -118,8 +118,8 @@ RSpec.describe Groups::EpicLinksController do
describe
'PUT #update'
do
before
do
epic1
.
update
(
parent:
parent_epic
)
epic2
.
update
(
parent:
parent_epic
)
epic1
.
update
!
(
parent:
parent_epic
)
epic2
.
update
!
(
parent:
parent_epic
)
end
let
(
:move_before_epic
)
{
epic2
}
...
...
@@ -173,7 +173,7 @@ RSpec.describe Groups::EpicLinksController do
describe
'DELETE #destroy'
do
before
do
epic1
.
update
(
parent:
parent_epic
)
epic1
.
update
!
(
parent:
parent_epic
)
end
let
(
:features_when_forbidden
)
{
{
epics:
false
}
}
...
...
ee/spec/controllers/groups/epics_controller_spec.rb
View file @
cfce6cb3
...
...
@@ -83,7 +83,7 @@ RSpec.describe Groups::EpicsController do
context
'when epics_sort is present'
do
it
'update epics_sort with current value'
do
user
.
user_preference
.
update
(
epics_sort:
'created_desc'
)
user
.
user_preference
.
update
!
(
epics_sort:
'created_desc'
)
get
:index
,
params:
{
group_id:
group
,
sort:
'start_date_asc'
}
...
...
ee/spec/controllers/groups/roadmap_controller_spec.rb
View file @
cfce6cb3
...
...
@@ -49,7 +49,7 @@ RSpec.describe Groups::RoadmapController do
end
it
'defaults to sort_value_start_date_soon'
do
user
.
user_preference
.
update
(
roadmaps_sort:
nil
)
user
.
user_preference
.
update
!
(
roadmaps_sort:
nil
)
get
:show
,
params:
{
group_id:
group
}
...
...
@@ -59,7 +59,7 @@ RSpec.describe Groups::RoadmapController do
context
'when roadmaps_sort is present'
do
it
'update roadmaps_sort with current value'
do
user
.
user_preference
.
update
(
roadmaps_sort:
'created_desc'
)
user
.
user_preference
.
update
!
(
roadmaps_sort:
'created_desc'
)
get
:show
,
params:
{
group_id:
group
,
sort:
'start_date_asc'
}
...
...
ee/spec/controllers/groups/sso_controller_spec.rb
View file @
cfce6cb3
...
...
@@ -92,7 +92,7 @@ RSpec.describe Groups::SsoController do
end
context
'when group has moved'
do
let
(
:redirect_route
)
{
group
.
redirect_routes
.
create
(
path:
'old-path'
)
}
let
(
:redirect_route
)
{
group
.
redirect_routes
.
create
!
(
path:
'old-path'
)
}
it
'redirects to new location'
do
get
:saml
,
params:
{
group_id:
redirect_route
.
path
}
...
...
@@ -193,7 +193,7 @@ RSpec.describe Groups::SsoController do
context
'and group managed accounts enforcing is disabled'
do
before
do
saml_provider
.
update
(
enforced_group_managed_accounts:
false
)
saml_provider
.
update
!
(
enforced_group_managed_accounts:
false
)
end
it
'renders 404'
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