summaryrefslogtreecommitdiff
path: root/spec/routing/group_routing_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/routing/group_routing_spec.rb')
-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