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
6ebf9396
Commit
6ebf9396
authored
Mar 30, 2021
by
Huzaifa Iftikhar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Rails/SaveBang Rubocop offenses for requests module
parent
fffdd5c4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
12 deletions
+10
-12
.rubocop_manual_todo.yml
.rubocop_manual_todo.yml
+0
-2
spec/requests/projects/cycle_analytics_events_spec.rb
spec/requests/projects/cycle_analytics_events_spec.rb
+2
-2
spec/requests/users_controller_spec.rb
spec/requests/users_controller_spec.rb
+8
-8
No files found.
.rubocop_manual_todo.yml
View file @
6ebf9396
...
@@ -408,8 +408,6 @@ Rails/SaveBang:
...
@@ -408,8 +408,6 @@ Rails/SaveBang:
-
'
spec/requests/api/jobs_spec.rb'
-
'
spec/requests/api/jobs_spec.rb'
-
'
spec/requests/api/labels_spec.rb'
-
'
spec/requests/api/labels_spec.rb'
-
'
spec/requests/api/project_import_spec.rb'
-
'
spec/requests/api/project_import_spec.rb'
-
'
spec/requests/projects/cycle_analytics_events_spec.rb'
-
'
spec/requests/users_controller_spec.rb'
Rails/TimeZone
:
Rails/TimeZone
:
Enabled
:
true
Enabled
:
true
...
...
spec/requests/projects/cycle_analytics_events_spec.rb
View file @
6ebf9396
...
@@ -75,7 +75,7 @@ RSpec.describe 'value stream analytics events' do
...
@@ -75,7 +75,7 @@ RSpec.describe 'value stream analytics events' do
context
'with private project and builds'
do
context
'with private project and builds'
do
before
do
before
do
project
.
members
.
last
.
update
(
access_level:
Gitlab
::
Access
::
GUEST
)
project
.
members
.
last
.
update
!
(
access_level:
Gitlab
::
Access
::
GUEST
)
end
end
it
'does not list the test events'
do
it
'does not list the test events'
do
...
@@ -100,7 +100,7 @@ RSpec.describe 'value stream analytics events' do
...
@@ -100,7 +100,7 @@ RSpec.describe 'value stream analytics events' do
def
create_cycle
def
create_cycle
milestone
=
create
(
:milestone
,
project:
project
)
milestone
=
create
(
:milestone
,
project:
project
)
issue
.
update
(
milestone:
milestone
)
issue
.
update
!
(
milestone:
milestone
)
mr
=
create_merge_request_closing_issue
(
user
,
project
,
issue
,
commit_message:
"References
#{
issue
.
to_reference
}
"
)
mr
=
create_merge_request_closing_issue
(
user
,
project
,
issue
,
commit_message:
"References
#{
issue
.
to_reference
}
"
)
pipeline
=
create
(
:ci_empty_pipeline
,
status:
'created'
,
project:
project
,
ref:
mr
.
source_branch
,
sha:
mr
.
source_branch_sha
,
head_pipeline_of:
mr
)
pipeline
=
create
(
:ci_empty_pipeline
,
status:
'created'
,
project:
project
,
ref:
mr
.
source_branch
,
sha:
mr
.
source_branch_sha
,
head_pipeline_of:
mr
)
...
...
spec/requests/users_controller_spec.rb
View file @
6ebf9396
...
@@ -663,7 +663,7 @@ RSpec.describe UsersController do
...
@@ -663,7 +663,7 @@ RSpec.describe UsersController do
end
end
context
'when a user changed their username'
do
context
'when a user changed their username'
do
let
(
:redirect_route
)
{
user
.
namespace
.
redirect_routes
.
create
(
path:
'old-username'
)
}
let
(
:redirect_route
)
{
user
.
namespace
.
redirect_routes
.
create
!
(
path:
'old-username'
)
}
it
'returns JSON indicating a user by that username does not exist'
do
it
'returns JSON indicating a user by that username does not exist'
do
get
user_exists_url
'old-username'
get
user_exists_url
'old-username'
...
@@ -705,7 +705,7 @@ RSpec.describe UsersController do
...
@@ -705,7 +705,7 @@ RSpec.describe UsersController do
end
end
context
'when a user changed their username'
do
context
'when a user changed their username'
do
let
(
:redirect_route
)
{
user
.
namespace
.
redirect_routes
.
create
(
path:
'old-username'
)
}
let
(
:redirect_route
)
{
user
.
namespace
.
redirect_routes
.
create
!
(
path:
'old-username'
)
}
it
'returns JSON indicating a user by that username does not exist'
do
it
'returns JSON indicating a user by that username does not exist'
do
get
user_suggests_url
'old-username'
get
user_suggests_url
'old-username'
...
@@ -755,19 +755,19 @@ RSpec.describe UsersController do
...
@@ -755,19 +755,19 @@ RSpec.describe UsersController do
end
end
context
'when requesting a redirected path'
do
context
'when requesting a redirected path'
do
let
(
:redirect_route
)
{
user
.
namespace
.
redirect_routes
.
create
(
path:
'old-path'
)
}
let
(
:redirect_route
)
{
user
.
namespace
.
redirect_routes
.
create
!
(
path:
'old-path'
)
}
it_behaves_like
'redirects to the canonical path'
it_behaves_like
'redirects to the canonical path'
context
'when the old path is a substring of the scheme or host'
do
context
'when the old path is a substring of the scheme or host'
do
let
(
:redirect_route
)
{
user
.
namespace
.
redirect_routes
.
create
(
path:
'http'
)
}
let
(
:redirect_route
)
{
user
.
namespace
.
redirect_routes
.
create
!
(
path:
'http'
)
}
# it does not modify the requested host and ...
# it does not modify the requested host and ...
it_behaves_like
'redirects to the canonical path'
it_behaves_like
'redirects to the canonical path'
end
end
context
'when the old path is substring of users'
do
context
'when the old path is substring of users'
do
let
(
:redirect_route
)
{
user
.
namespace
.
redirect_routes
.
create
(
path:
'ser'
)
}
let
(
:redirect_route
)
{
user
.
namespace
.
redirect_routes
.
create
!
(
path:
'ser'
)
}
it_behaves_like
'redirects to the canonical path'
it_behaves_like
'redirects to the canonical path'
end
end
...
@@ -806,19 +806,19 @@ RSpec.describe UsersController do
...
@@ -806,19 +806,19 @@ RSpec.describe UsersController do
end
end
context
'when requesting a redirected path'
do
context
'when requesting a redirected path'
do
let
(
:redirect_route
)
{
user
.
namespace
.
redirect_routes
.
create
(
path:
'old-path'
)
}
let
(
:redirect_route
)
{
user
.
namespace
.
redirect_routes
.
create
!
(
path:
'old-path'
)
}
it_behaves_like
'redirects to the canonical path'
it_behaves_like
'redirects to the canonical path'
context
'when the old path is a substring of the scheme or host'
do
context
'when the old path is a substring of the scheme or host'
do
let
(
:redirect_route
)
{
user
.
namespace
.
redirect_routes
.
create
(
path:
'http'
)
}
let
(
:redirect_route
)
{
user
.
namespace
.
redirect_routes
.
create
!
(
path:
'http'
)
}
# it does not modify the requested host and ...
# it does not modify the requested host and ...
it_behaves_like
'redirects to the canonical path'
it_behaves_like
'redirects to the canonical path'
end
end
context
'when the old path is substring of users'
do
context
'when the old path is substring of users'
do
let
(
:redirect_route
)
{
user
.
namespace
.
redirect_routes
.
create
(
path:
'ser'
)
}
let
(
:redirect_route
)
{
user
.
namespace
.
redirect_routes
.
create
!
(
path:
'ser'
)
}
# it does not modify the /users part of the path
# it does not modify the /users part of the path
# (i.e. /users/ser should not become /ufoos/ser) and ...
# (i.e. /users/ser should not become /ufoos/ser) and ...
...
...
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