summaryrefslogtreecommitdiff
path: root/spec/routing
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2017-10-26 16:10:03 +0200
committerBob Van Landuyt <bob@vanlanduyt.co>2017-11-07 19:52:09 +0100
commit5d14337baff9c2ae8091b7b4ab954f8024449a52 (patch)
treed5d18ed1d0c31e5aff9d029b483eda418a0c72de /spec/routing
parent414c4e3fd83a6a3cae623dcc8135d6ef09a30562 (diff)
downloadgitlab-ce-5d14337baff9c2ae8091b7b4ab954f8024449a52.tar.gz
Free up `labels` as a group name
Diffstat (limited to 'spec/routing')
-rw-r--r--spec/routing/group_routing_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/routing/group_routing_spec.rb b/spec/routing/group_routing_spec.rb
new file mode 100644
index 00000000000..39fbf082b4d
--- /dev/null
+++ b/spec/routing/group_routing_spec.rb
@@ -0,0 +1,18 @@
+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