Return a 403 instead of 200 when trying to delete a user with posts

See [this commit][1] for more info

[1]: bd352a17bf
This commit is contained in:
Blake Erickson
2018-05-22 16:17:44 -06:00
parent 609804f5ef
commit 3edca8b104
2 changed files with 2 additions and 2 deletions

View File

@@ -531,7 +531,7 @@ describe Admin::UsersController do
it "returns an api response that the user can't be deleted because it has posts" do
delete :destroy, params: { id: delete_me.id }, format: :json
expect(response).to be_success
expect(response).to be_forbidden
json = ::JSON.parse(response.body)
expect(json['deleted']).to eq(false)
end