DEV: add activate/deactivate user endpoints to API docs (#22716)

* DEV: add activate/deactivate user endpoints to API docs

* Update spec/requests/api/users_spec.rb

---------

Co-authored-by: Blake Erickson <o.blakeerickson@gmail.com>
This commit is contained in:
Canapin 2023-07-24 19:45:04 +02:00 committed by GitHub
parent 3389b3eeb0
commit e503a4fc37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 46 additions and 0 deletions

View File

@ -358,6 +358,52 @@ RSpec.describe "users" do
end
end
path "/admin/users/{id}/activate.json" do
put "Activate a user" do
tags "Users", "Admin"
operationId "activateUser"
consumes "application/json"
expected_request_schema = nil
parameter name: :id, in: :path, type: :integer, required: true
produces "application/json"
response "200", "response" do
let(:id) { Fabricate(:user, active: false).id }
expected_response_schema = load_spec_schema("success_ok_response")
schema(expected_response_schema)
it_behaves_like "a JSON endpoint", 200 do
let(:expected_response_schema) { expected_response_schema }
let(:expected_request_schema) { expected_request_schema }
end
end
end
end
path "/admin/users/{id}/deactivate.json" do
put "Deactivate a user" do
tags "Users", "Admin"
operationId "deactivateUser"
consumes "application/json"
expected_request_schema = nil
parameter name: :id, in: :path, type: :integer, required: true
produces "application/json"
response "200", "response" do
let(:id) { Fabricate(:user).id }
expected_response_schema = load_spec_schema("success_ok_response")
schema(expected_response_schema)
it_behaves_like "a JSON endpoint", 200 do
let(:expected_response_schema) { expected_response_schema }
let(:expected_request_schema) { expected_request_schema }
end
end
end
end
path "/admin/users/{id}/suspend.json" do
put "Suspend a user" do
tags "Users", "Admin"