Add network and graphs to legacy routes too

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
Dmitriy Zaporozhets 2019-05-21 12:15:37 +03:00
parent 6d3f5a3341
commit eef6f76821
No known key found for this signature in database
GPG Key ID: 627C5F589F467F17
2 changed files with 3 additions and 1 deletions

View File

@ -507,7 +507,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
constraints: { project_id: Gitlab::PathRegex.project_route_regex },
module: :projects,
as: :project) do
Gitlab::Routing.redirect_legacy_paths(self, :settings, :branches, :tags)
Gitlab::Routing.redirect_legacy_paths(self, :settings, :branches, :tags, :network, :graphs)
end
end
end

View File

@ -609,6 +609,8 @@ describe 'project routing' do
expect(get('/gitlab/gitlabhq/-/graphs/ends-with.json')).to route_to('projects/graphs#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'ends-with.json')
expect(get('/gitlab/gitlabhq/-/graphs/master?format=json')).to route_to('projects/graphs#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master', format: 'json')
end
it_behaves_like 'redirecting a legacy project path', "/gitlab/gitlabhq/graphs/master", "/gitlab/gitlabhq/-/graphs/master"
end
describe Projects::ForksController, 'routing' do