Commit 6f03fa5b authored by Thong Kuah's avatar Thong Kuah

Fix for notification setting for group with dot char in name

The issue is that Rails is parsing the dot for the :format parameter, so
we add the constraint to tell rails the dot is part of the :id
parameter.
parent 0e826330
---
title: Fix notification setting for group with dot in name
merge_request: 38773
author:
type: fixed
......@@ -22,7 +22,7 @@ resource :profile, only: [:show, :update] do
end
resource :notifications, only: [:show, :update] do
resources :groups, only: :update
resources :groups, only: :update, constraints: { id: Gitlab::PathRegex.full_namespace_route_regex }
end
resource :password, only: [:new, :create, :edit, :update] do
......
......@@ -10,4 +10,9 @@ RSpec.describe "notifications routing" do
it "routes to #update" do
expect(put("/profile/notifications")).to route_to("profiles/notifications#update")
end
it 'routes to group #update' do
expect(put("/profile/notifications/groups/gitlab-org")).to route_to("profiles/groups#update", id: 'gitlab-org')
expect(put("/profile/notifications/groups/gitlab.org")).to route_to("profiles/groups#update", id: 'gitlab.org')
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