FIX: PM tags route should work for usernames with a period.

This commit is contained in:
Alan Guo Xiang Tan 2021-07-29 13:43:25 +08:00
parent 4dc5452682
commit 543a2d70b2
2 changed files with 9 additions and 1 deletions

View File

@ -922,7 +922,7 @@ Discourse::Application.routes.draw do
get '/' => 'tags#index'
get '/filter/list' => 'tags#index'
get '/filter/search' => 'tags#search'
get '/personal_messages/:username' => 'tags#personal_messages'
get '/personal_messages/:username' => 'tags#personal_messages', constraints: { username: RouteFormat.username }
post '/upload' => 'tags#upload'
get '/unused' => 'tags#list_unused'
delete '/unused' => 'tags#destroy_unused'

View File

@ -520,6 +520,14 @@ describe TagsController do
tag = response.parsed_body['tags']
expect(tag[0]["id"]).to eq('test')
end
it 'works with usernames with a period' do
admin.update!(username: "test.test")
get "/tags/personal_messages/#{admin.username}.json"
expect(response.status).to eq(200)
end
end
end