Commit e9f08fac authored by Felipe Artur's avatar Felipe Artur

Prevent rendering test case as an issue

Redirect to test cases show when
when visiting a test case from an issue url
parent e8a9a795
......@@ -14,6 +14,8 @@ module EE
populate_vulnerability_id
end
before_action :redirect_if_test_case, only: [:show]
feature_category :issue_tracking, [:delete_description_version, :description_diff]
end
......@@ -113,6 +115,12 @@ module EE
def populate_vulnerability_id
self.vulnerability_id = params[:vulnerability_id] if can?(current_user, :read_vulnerability, project)
end
def redirect_if_test_case
return unless issue.test_case?
redirect_to project_quality_test_case_path(project, issue)
end
end
end
end
---
title: Prevent rendering test cases as issues
merge_request: 55410
author:
type: fixed
......@@ -36,6 +36,20 @@ RSpec.describe Projects::IssuesController do
expect { get_show }.not_to exceed_query_limit(control)
end
end
context 'with test case' do
before do
project.add_guest(user)
end
it 'redirects to test cases show' do
test_case = create(:quality_test_case, project: project)
get project_issue_path(project, test_case)
expect(response).to redirect_to(project_quality_test_case_path(project, test_case))
end
end
end
describe 'GET #index' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment