From 9f36012e026845e87c39d5f142abbaa44bde8f2b Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Wed, 19 Jul 2017 10:30:57 +0200 Subject: Fix docker tag reference routing constraints --- spec/routing/project_routing_spec.rb | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'spec/routing') 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 -- cgit v1.2.1