BigW Consortium Gitlab

Commit 5d14337b by Bob Van Landuyt

Free up `labels` as a group name

parent 414c4e3f
......@@ -34,10 +34,6 @@ constraints(GroupUrlConstrainer.new) do
end
end
resources :labels, except: [:show] do
post :toggle_subscription, on: :member
end
scope path: '-' do
namespace :settings do
resource :ci_cd, only: [:show], controller: 'ci_cd'
......@@ -46,6 +42,10 @@ constraints(GroupUrlConstrainer.new) do
resources :variables, only: [:index, :show, :update, :create, :destroy]
resources :children, only: [:index]
resources :labels, except: [:show] do
post :toggle_subscription, on: :member
end
end
end
......@@ -58,4 +58,10 @@ constraints(GroupUrlConstrainer.new) do
put '/', action: :update
delete '/', action: :destroy
end
# Legacy paths should be defined last, so they would be ignored if routes with
# one of the previously reserved words exist.
scope(path: 'groups/*group_id') do
Gitlab::Routing.redirect_legacy_paths(self, :labels)
end
end
......@@ -120,7 +120,6 @@ module Gitlab
group_members
hooks
issues
labels
ldap
ldap_group_links
merge_requests
......
require 'spec_helper'
describe 'group routing' do
let!(:existing_group) { create(:group, parent: create(:group, path: 'gitlab-org'), path: 'infra') }
describe 'GET #labels' do
it 'routes to the correct controller' do
expect(get('/groups/gitlab-org/infra/-/labels'))
.to route_to(group_id: 'gitlab-org/infra',
controller: 'groups/labels',
action: 'index')
end
it_behaves_like 'redirecting a legacy path', '/groups/gitlab-org/infra/labels', '/groups/gitlab-org/infra/-/labels' do
let(:resource) { create(:group, parent: existing_group, path: 'labels') }
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment