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
cfc199ab
Commit
cfc199ab
authored
Aug 19, 2021
by
charlie ablett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test case return 404 instead of 500 error
Changelog: added EE: true
parent
60cc382d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
1 deletion
+25
-1
ee/app/controllers/projects/quality/test_cases_controller.rb
ee/app/controllers/projects/quality/test_cases_controller.rb
+1
-1
ee/spec/controllers/projects/quality/test_cases_controller_spec.rb
...ontrollers/projects/quality/test_cases_controller_spec.rb
+10
-0
ee/spec/features/projects/quality/test_case_show_spec.rb
ee/spec/features/projects/quality/test_case_show_spec.rb
+14
-0
No files found.
ee/app/controllers/projects/quality/test_cases_controller.rb
View file @
cfc199ab
...
@@ -26,7 +26,7 @@ class Projects::Quality::TestCasesController < Projects::ApplicationController
...
@@ -26,7 +26,7 @@ class Projects::Quality::TestCasesController < Projects::ApplicationController
.
execute
.
execute
.
iid_in
(
params
[
:id
])
.
iid_in
(
params
[
:id
])
.
without_order
.
without_order
.
first
.
take!
# rubocop: disable CodeReuse/ActiveRecord
serializer
=
IssueSerializer
.
new
(
current_user:
current_user
,
project:
project
)
serializer
=
IssueSerializer
.
new
(
current_user:
current_user
,
project:
project
)
...
...
ee/spec/controllers/projects/quality/test_cases_controller_spec.rb
View file @
cfc199ab
...
@@ -108,6 +108,16 @@ RSpec.describe Projects::Quality::TestCasesController do
...
@@ -108,6 +108,16 @@ RSpec.describe Projects::Quality::TestCasesController do
expect
(
assigns
(
:test_case
)).
to
eq
(
test_case
)
expect
(
assigns
(
:test_case
)).
to
eq
(
test_case
)
expect
(
assigns
(
:issuable_sidebar
)).
to
be_present
expect
(
assigns
(
:issuable_sidebar
)).
to
be_present
end
end
context
'when test case is not found'
do
let
(
:test_case
)
{
non_existing_record_id
}
it
'returns 404'
do
subject
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
end
end
end
end
end
end
...
...
ee/spec/features/projects/quality/test_case_show_spec.rb
View file @
cfc199ab
...
@@ -179,4 +179,18 @@ RSpec.describe 'Test Cases', :js do
...
@@ -179,4 +179,18 @@ RSpec.describe 'Test Cases', :js do
end
end
end
end
end
end
describe
'for a nonexistent test case'
do
let
(
:test_case
)
{
non_existing_record_id
}
it
'renders 404 page'
do
requests
=
inspect_requests
do
visit
project_quality_test_case_path
(
project
,
test_case
)
wait_for_all_requests
end
expect
(
requests
.
first
.
status_code
).
to
eq
(
404
)
end
end
end
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