summaryrefslogtreecommitdiff
path: root/spec/routing
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-05-19 19:46:40 -0500
committerDouwe Maan <douwe@selenight.nl>2017-05-23 20:38:24 -0500
commit4345bb8c507a11af694617187dea14284f48fb96 (patch)
tree20bc96bf6f90f8654492fb4e8b5cb1108e3d131d /spec/routing
parent3cfcbcf35badfdb21244f7f16c8640cd83b49205 (diff)
downloadgitlab-ce-4345bb8c507a11af694617187dea14284f48fb96.tar.gz
Fix ambiguous routing issues by teaching router about reserved words
Diffstat (limited to 'spec/routing')
-rw-r--r--spec/routing/project_routing_spec.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/routing/project_routing_spec.rb b/spec/routing/project_routing_spec.rb
index d5400bbaaf1..a391c046f92 100644
--- a/spec/routing/project_routing_spec.rb
+++ b/spec/routing/project_routing_spec.rb
@@ -462,6 +462,8 @@ describe 'project routing' do
expect(get('/gitlab/gitlabhq/blob/master/app/models/compare.rb')).to route_to('projects/blob#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/app/models/compare.rb')
expect(get('/gitlab/gitlabhq/blob/master/app/models/diff.js')).to route_to('projects/blob#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/app/models/diff.js')
expect(get('/gitlab/gitlabhq/blob/master/files.scss')).to route_to('projects/blob#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/files.scss')
+ expect(get('/gitlab/gitlabhq/blob/master/blob/index.js')).to route_to('projects/blob#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/blob/index.js')
+ expect(get('/gitlab/gitlabhq/blob/blob/master/blob/index.js')).to route_to('projects/blob#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'blob/master/blob/index.js')
end
end
@@ -470,6 +472,8 @@ describe 'project routing' do
it 'to #show' do
expect(get('/gitlab/gitlabhq/tree/master/app/models/project.rb')).to route_to('projects/tree#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/app/models/project.rb')
expect(get('/gitlab/gitlabhq/tree/master/files.scss')).to route_to('projects/tree#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/files.scss')
+ expect(get('/gitlab/gitlabhq/tree/master/tree/files')).to route_to('projects/tree#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/tree/files')
+ expect(get('/gitlab/gitlabhq/tree/tree/master/tree/files')).to route_to('projects/tree#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'tree/master/tree/files')
end
end