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:
Jarek Radosz
2020-04-21 03:50:20 +02:00
committed by GitHub
parent 28c706bd09
commit 17cf300b71
14 changed files with 121 additions and 20 deletions

View File

@@ -380,6 +380,7 @@ describe ReviewablesController do
ReviewableClaimedTopic.create!(topic_id: qp.topic_id, user: Fabricate(:admin))
put "/review/#{qp.id}/perform/approve_post.json?version=#{qp.version}"
expect(response.code).to eq("422")
expect(response.parsed_body["errors"]).to match_array(["This item has been claimed by another user."])
end
it "works when claims are optional" do