From eef6f768219e994fd3847694310e78040eb89815 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 21 May 2019 12:15:37 +0300 Subject: Add network and graphs to legacy routes too Signed-off-by: Dmitriy Zaporozhets --- config/routes/project.rb | 2 +- spec/routing/project_routing_spec.rb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/config/routes/project.rb b/config/routes/project.rb index 65e2d814c7c..fdc2a3c0086 100644 --- a/config/routes/project.rb +++ b/config/routes/project.rb @@ -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 diff --git a/spec/routing/project_routing_spec.rb b/spec/routing/project_routing_spec.rb index 9c2a824bab2..dd9540c11d1 100644 --- a/spec/routing/project_routing_spec.rb +++ b/spec/routing/project_routing_spec.rb @@ -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 -- cgit v1.2.1