Commit a3aa78d8 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'issue_300147' into 'master'

Redirect to test cases show when using issues url

See merge request gitlab-org/gitlab!55410
parents 9a40837f e9f08fac
......@@ -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