diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2019-05-21 11:35:29 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2019-05-21 11:35:29 +0300 |
commit | 6d3f5a33419a6dd52d4f6378f674e28eb22ad323 (patch) | |
tree | 94fd7a9c57b924f7dced199763d6ae455cfc3af3 /spec/routing | |
parent | 70decdc2acb4da895bdd63bb15b46014045af661 (diff) |
Add legacy routes for modified project path
For settings, branches and tags
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'spec/routing')
-rw-r--r-- | spec/routing/project_routing_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/routing/project_routing_spec.rb b/spec/routing/project_routing_spec.rb index 174293fe70c..9c2a824bab2 100644 --- a/spec/routing/project_routing_spec.rb +++ b/spec/routing/project_routing_spec.rb @@ -212,6 +212,8 @@ describe 'project routing' do expect(delete('/gitlab/gitlabhq/-/branches/feature%2B45/foo/bar/baz')).to route_to('projects/branches#destroy', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature+45/foo/bar/baz') expect(delete('/gitlab/gitlabhq/-/branches/feature@45/foo/bar/baz')).to route_to('projects/branches#destroy', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature@45/foo/bar/baz') end + + it_behaves_like 'redirecting a legacy project path', "/gitlab/gitlabhq/branches", "/gitlab/gitlabhq/-/branches" end describe Projects::TagsController, 'routing' do @@ -597,6 +599,8 @@ describe 'project routing' do expect(get('/gitlab/gitlabhq/-/network/ends-with.json')).to route_to('projects/network#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'ends-with.json') expect(get('/gitlab/gitlabhq/-/network/master?format=json')).to route_to('projects/network#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master', format: 'json') end + + it_behaves_like 'redirecting a legacy project path', "/gitlab/gitlabhq/network/master", "/gitlab/gitlabhq/-/network/master" end describe Projects::GraphsController, 'routing' do @@ -662,4 +666,12 @@ describe 'project routing' do end end end + + describe Projects::Settings::RepositoryController, 'routing' do + it 'to #show' do + expect(get('/gitlab/gitlabhq/-/settings/repository')).to route_to('projects/settings/repository#show', namespace_id: 'gitlab', project_id: 'gitlabhq') + end + + it_behaves_like 'redirecting a legacy project path', "/gitlab/gitlabhq/settings/repository", "/gitlab/gitlabhq/-/settings/repository" + end end |