summaryrefslogtreecommitdiff
path: root/spec/routing
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-07-19 10:30:57 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-07-19 10:30:57 +0200
commit9f36012e026845e87c39d5f142abbaa44bde8f2b (patch)
tree41a6911277510ca880dd7491f2a91524046435f1 /spec/routing
parent9e5c8e5d7f81b88998c8def2f4a20d54eeee49d0 (diff)
downloadgitlab-ce-9f36012e026845e87c39d5f142abbaa44bde8f2b.tar.gz
Fix docker tag reference routing constraints
Diffstat (limited to 'spec/routing')
-rw-r--r--spec/routing/project_routing_spec.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/routing/project_routing_spec.rb b/spec/routing/project_routing_spec.rb
index 2f1c3c95e59..65314b688a4 100644
--- a/spec/routing/project_routing_spec.rb
+++ b/spec/routing/project_routing_spec.rb
@@ -609,4 +609,26 @@ describe 'project routing' do
expect(get('/gitlab/gitlabhq/pages/domains/my.domain.com')).to route_to('projects/pages_domains#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'my.domain.com')
end
end
+
+ describe Projects::Registry::TagsController, :routing do
+ describe '#destroy' do
+ it 'correctly routes to a destroy action' do
+ expect(delete('/gitlab/gitlabhq/registry/repository/1/tags/rc1'))
+ .to route_to('projects/registry/tags#destroy',
+ namespace_id: 'gitlab',
+ project_id: 'gitlabhq',
+ repository_id: '1',
+ id: 'rc1')
+ end
+
+ it 'takes registry tag name constrains into account' do
+ expect(delete('/gitlab/gitlabhq/registry/repository/1/tags/-rc1'))
+ .not_to route_to('projects/registry/tags#destroy',
+ namespace_id: 'gitlab',
+ project_id: 'gitlabhq',
+ repository_id: '1',
+ id: '-rc1')
+ end
+ end
+ end
end