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
90a3825c
Commit
90a3825c
authored
Feb 19, 2020
by
Peter Leitzen
Committed by
Nick Thomas
Feb 19, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add http status cop to some subdir request specs
285 files inspected, 21 offenses detected, 21 offenses corrected
parent
ffbbcfb7
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
23 additions
and
21 deletions
+23
-21
.rubocop.yml
.rubocop.yml
+2
-0
ee/spec/requests/groups/roadmap_controller_spec.rb
ee/spec/requests/groups/roadmap_controller_spec.rb
+4
-4
ee/spec/requests/groups/security/vulnerable_projects_index_spec.rb
...equests/groups/security/vulnerable_projects_index_spec.rb
+1
-1
ee/spec/requests/projects/analytics/code_reviews_controller_spec.rb
...quests/projects/analytics/code_reviews_controller_spec.rb
+3
-3
ee/spec/requests/projects/issue_links_controller_spec.rb
ee/spec/requests/projects/issue_links_controller_spec.rb
+7
-7
ee/spec/requests/projects/mirrors_controller_spec.rb
ee/spec/requests/projects/mirrors_controller_spec.rb
+1
-1
ee/spec/requests/repositories/git_http_controller_spec.rb
ee/spec/requests/repositories/git_http_controller_spec.rb
+3
-3
spec/requests/groups/milestones_controller_spec.rb
spec/requests/groups/milestones_controller_spec.rb
+1
-1
spec/requests/groups/registry/repositories_controller_spec.rb
.../requests/groups/registry/repositories_controller_spec.rb
+1
-1
No files found.
.rubocop.yml
View file @
90a3825c
...
...
@@ -345,6 +345,8 @@ RSpec/HaveGitlabHttpStatus:
-
'
ee/spec/controllers/**/*'
-
'
spec/requests/*.rb'
-
'
ee/spec/requests/*.rb'
-
'
spec/requests/{groups,projects,repositories}/**/*'
-
'
ee/spec/requests/{groups,projects,repositories}/**/*'
-
'
spec/requests/api/*/**/*.rb'
-
'
ee/spec/requests/api/*/**/*.rb'
...
...
ee/spec/requests/groups/roadmap_controller_spec.rb
View file @
90a3825c
...
...
@@ -18,7 +18,7 @@ describe Groups::RoadmapController do
get
group_roadmap_path
(
group
,
layout:
layout
)
end
.
not_to
change
{
user
.
reload
.
roadmap_layout
}
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
end
end
...
...
@@ -36,7 +36,7 @@ describe Groups::RoadmapController do
get
group_roadmap_path
(
group
)
end
.
not_to
change
{
user
.
reload
.
roadmap_layout
}
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
end
end
...
...
@@ -45,7 +45,7 @@ describe Groups::RoadmapController do
expect
(
Users
::
UpdateService
).
not_to
receive
(
:new
).
with
(
user
,
user:
user
,
roadmap_layout:
a_kind_of
(
String
))
get
group_roadmap_path
(
group
,
layout:
'FOO'
)
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
end
end
...
...
@@ -58,7 +58,7 @@ describe Groups::RoadmapController do
get
group_roadmap_path
(
group
,
layout:
layout
)
end
.
to
change
{
user
.
reload
.
roadmap_layout
}.
to
(
layout
.
downcase
)
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
end
end
end
...
...
ee/spec/requests/groups/security/vulnerable_projects_index_spec.rb
View file @
90a3825c
...
...
@@ -33,7 +33,7 @@ describe 'GET /groups/*group_id/-/security/projects' do
get
group_security_vulnerable_projects_path
(
group
,
format: :json
)
end
.
not_to
exceed_query_limit
(
control_count
)
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
json_response
.
size
).
to
be
(
3
)
end
end
ee/spec/requests/projects/analytics/code_reviews_controller_spec.rb
View file @
90a3825c
...
...
@@ -20,7 +20,7 @@ describe Projects::Analytics::CodeReviewsController, type: :request do
it
'is success'
do
get
project_analytics_code_reviews_path
(
project
)
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
end
end
...
...
@@ -32,7 +32,7 @@ describe Projects::Analytics::CodeReviewsController, type: :request do
it
'is not found'
do
get
project_analytics_code_reviews_path
(
project
)
expect
(
response
).
to
have_gitlab_http_status
(
404
)
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
end
...
...
@@ -45,7 +45,7 @@ describe Projects::Analytics::CodeReviewsController, type: :request do
it
'is not found'
do
get
project_analytics_code_reviews_path
(
project
)
expect
(
response
).
to
have_gitlab_http_status
(
404
)
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
end
...
...
ee/spec/requests/projects/issue_links_controller_spec.rb
View file @
90a3825c
...
...
@@ -25,7 +25,7 @@ describe Projects::IssueLinksController do
get
namespace_project_issue_links_path
(
issue_links_params
)
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
json_response
).
to
eq
(
list_service_response
.
as_json
)
end
end
...
...
@@ -47,7 +47,7 @@ describe Projects::IssueLinksController do
list_service_response
=
IssueLinks
::
ListService
.
new
(
issue
,
user
).
execute
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
json_response
).
to
eq
(
'message'
=>
nil
,
'issuables'
=>
list_service_response
.
as_json
)
end
...
...
@@ -61,7 +61,7 @@ describe Projects::IssueLinksController do
it
'returns 403'
do
post
namespace_project_issue_links_path
(
issue_links_params
(
issuable_references:
issuable_references
))
expect
(
response
).
to
have_gitlab_http_status
(
403
)
expect
(
response
).
to
have_gitlab_http_status
(
:forbidden
)
end
end
...
...
@@ -74,7 +74,7 @@ describe Projects::IssueLinksController do
list_service_response
=
IssueLinks
::
ListService
.
new
(
issue
,
user
).
execute
expect
(
response
).
to
have_gitlab_http_status
(
404
)
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
expect
(
json_response
).
to
eq
(
'message'
=>
'No Issue found for given params'
,
'issuables'
=>
list_service_response
.
as_json
)
end
end
...
...
@@ -97,7 +97,7 @@ describe Projects::IssueLinksController do
it
'returns 403'
do
delete
namespace_project_issue_link_path
(
issue_links_params
(
id:
issue_link
.
id
))
expect
(
response
).
to
have_gitlab_http_status
(
403
)
expect
(
response
).
to
have_gitlab_http_status
(
:forbidden
)
end
end
...
...
@@ -109,7 +109,7 @@ describe Projects::IssueLinksController do
it
'returns 404'
do
delete
namespace_project_issue_link_path
(
issue_links_params
(
id:
issue_link
.
id
))
expect
(
response
).
to
have_gitlab_http_status
(
404
)
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
end
...
...
@@ -142,7 +142,7 @@ describe Projects::IssueLinksController do
it
'returns 404'
do
subject
expect
(
response
).
to
have_gitlab_http_status
(
404
)
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
it
'does not delete the link'
do
...
...
ee/spec/requests/projects/mirrors_controller_spec.rb
View file @
90a3825c
...
...
@@ -28,7 +28,7 @@ describe Projects::MirrorsController do
}
}
expect
(
response
).
to
have_gitlab_http_status
(
302
)
expect
(
response
).
to
have_gitlab_http_status
(
:found
)
expect
(
response
).
to
redirect_to
(
project_settings_repository_path
(
project
,
anchor:
'js-push-remote-settings'
))
expect
(
flash
[
:alert
]).
to
include
(
"Import url can't be blank"
)
end
...
...
ee/spec/requests/repositories/git_http_controller_spec.rb
View file @
90a3825c
...
...
@@ -37,7 +37,7 @@ describe Repositories::GitHttpController, type: :request do
it
"allows access"
do
subject
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
end
end
...
...
@@ -45,7 +45,7 @@ describe Repositories::GitHttpController, type: :request do
it
"does not allow access"
do
subject
expect
(
response
).
to
have_gitlab_http_status
(
403
)
expect
(
response
).
to
have_gitlab_http_status
(
:forbidden
)
expect
(
response
.
body
).
to
eq
(
'Project requires smartcard login. Please login to GitLab using a smartcard.'
)
end
end
...
...
@@ -58,7 +58,7 @@ describe Repositories::GitHttpController, type: :request do
it
"allows access"
do
subject
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
end
end
end
...
...
spec/requests/groups/milestones_controller_spec.rb
View file @
90a3825c
...
...
@@ -24,7 +24,7 @@ describe Groups::MilestonesController do
end
expect
{
get
"/groups/
#{
public_group
.
to_param
}
/-/milestones.json"
}.
not_to
exceed_all_query_limit
(
control_count
)
expect
(
response
).
to
have_
http_status
(
200
)
expect
(
response
).
to
have_
gitlab_http_status
(
:ok
)
milestones
=
json_response
expect
(
milestones
.
count
).
to
eq
(
3
)
...
...
spec/requests/groups/registry/repositories_controller_spec.rb
View file @
90a3825c
...
...
@@ -28,7 +28,7 @@ describe Groups::Registry::RepositoriesController do
expect
{
get
(
endpoint
)
}.
not_to
exceed_all_query_limit
(
control_count
)
# sanity check that response is 200
expect
(
response
).
to
have_
http_status
(
200
)
expect
(
response
).
to
have_
gitlab_http_status
(
:ok
)
repositories
=
json_response
expect
(
repositories
.
count
).
to
eq
(
5
)
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