Fix regression introduced in 2ceb107074.

This commit is contained in:
Guo Xiang Tan 2018-05-21 13:25:56 +08:00
parent db23e10efa
commit b7b08b4173
2 changed files with 3 additions and 3 deletions

View File

@ -214,7 +214,7 @@ Discourse::Application.routes.draw do
# They have periods in their URLs often: # They have periods in their URLs often:
get 'site_texts' => 'site_texts#index' get 'site_texts' => 'site_texts#index'
get 'site_texts/:id' => 'site_texts#show', constraints: { id: /[\w.\-\+]+/i } get 'site_texts/:id' => 'site_texts#show', constraints: { id: /[\w.\-\+]+/i }
put 'site_texts/:id.json' => 'site_texts#update', constraints: { id: /[\w.\-\+]+/i } put 'site_texts/:id' => 'site_texts#update', constraints: { id: /[\w.\-\+]+[^.json]/i }
delete 'site_texts/:id' => 'site_texts#revert', constraints: { id: /[\w.\-\+]+/i } delete 'site_texts/:id' => 'site_texts#revert', constraints: { id: /[\w.\-\+]+/i }
get 'email_templates' => 'email_templates#index' get 'email_templates' => 'email_templates#index'

View File

@ -45,7 +45,7 @@ RSpec.describe Admin::SiteTextsController do
end end
it "works as expectd with correct keys" do it "works as expectd with correct keys" do
put '/admin/customize/site_texts/title.json', params: { put '/admin/customize/site_texts/login_required.welcome_message.json', params: {
site_text: { value: 'foo' } site_text: { value: 'foo' }
} }
@ -54,7 +54,7 @@ RSpec.describe Admin::SiteTextsController do
json = ::JSON.parse(response.body) json = ::JSON.parse(response.body)
site_text = json['site_text'] site_text = json['site_text']
expect(site_text['id']).to eq('title') expect(site_text['id']).to eq('login_required.welcome_message')
expect(site_text['value']).to eq('foo') expect(site_text['value']).to eq('foo')
end end