mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 07:11:34 +08:00
DEV: Use more specific error responses (#9472)
* DEV: Use `render_json_error` (Adds specs for Admin::GroupsController) * DEV: Use a specific error on blank category slug (Fixes a `render_json_error` warning) * DEV: Use a specific error on reviewable claim conflict (Fixes a `render_json_error` warning) * DEV: Use specific errors in Admin::UsersController (Fixes `render_json_error` warnings) * FIX: PublishedPages error responses * FIX: TopicsController error responses (There was an issue of two separate `Topic` instances for the same record. This makes sure there's only one up-to-date instance.)
This commit is contained in:
@ -452,8 +452,9 @@ describe CategoriesController do
|
||||
end
|
||||
|
||||
it 'rejects blank' do
|
||||
put "/category/#{category.id}/slug.json", params: { slug: nil }
|
||||
put "/category/#{category.id}/slug.json", params: { slug: ' ' }
|
||||
expect(response.status).to eq(422)
|
||||
expect(response.parsed_body["errors"]).to eq(["Slug can't be blank"])
|
||||
end
|
||||
|
||||
it 'accepts valid custom slug' do
|
||||
|
Reference in New Issue
Block a user