Commit 7f1d9548 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix 500 error when visit group from admin area if group name contains dot

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent b93c72e3
---
title: Fix 500 error when visit group from admin area if group name contains dot
merge_request:
author:
...@@ -32,7 +32,7 @@ namespace :admin do ...@@ -32,7 +32,7 @@ namespace :admin do
scope(path: 'groups/*id', scope(path: 'groups/*id',
controller: :groups, controller: :groups,
constraints: { id: Gitlab::Regex.namespace_route_regex }) do constraints: { id: Gitlab::Regex.namespace_route_regex, format: /(html|json|atom)/ }) do
scope(as: :group) do scope(as: :group) do
put :members_update put :members_update
......
...@@ -122,12 +122,18 @@ describe Admin::HealthCheckController, "routing" do ...@@ -122,12 +122,18 @@ describe Admin::HealthCheckController, "routing" do
end end
describe Admin::GroupsController, "routing" do describe Admin::GroupsController, "routing" do
let(:name) { 'complex.group-namegit' }
it "to #index" do it "to #index" do
expect(get("/admin/groups")).to route_to('admin/groups#index') expect(get("/admin/groups")).to route_to('admin/groups#index')
end end
it "to #show" do it "to #show" do
expect(get("/admin/groups/gitlab")).to route_to('admin/groups#show', id: 'gitlab') expect(get("/admin/groups/#{name}")).to route_to('admin/groups#show', id: name)
expect(get("/admin/groups/gitlab/subgroup")).to route_to('admin/groups#show', id: 'gitlab/subgroup') expect(get("/admin/groups/#{name}/subgroup")).to route_to('admin/groups#show', id: "#{name}/subgroup")
end
it "to #edit" do
expect(get("/admin/groups/#{name}/edit")).to route_to('admin/groups#edit', id: name)
end 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