mirror of
https://github.com/discourse/discourse.git
synced 2025-01-16 05:32:41 +08:00
DEV: Make silence_reason and can_be_deleted optional (#30647)
In the api docs note that `silence_reason` and `can_be_deleted` are
optional responses for the admin user api response.
Follow up to: 9cf78ba195
> TODO @blake / @sam - this is not passing cause "silence_reason" is a conditional attribute
> (also can_be_deleted is) - we need to figure out how to not include it in the schema - it is not included
> in the admin response by design
This commit is contained in:
parent
55914bf9a3
commit
6811296b24
|
@ -533,11 +533,9 @@
|
|||
"flags_received_count",
|
||||
"private_topics_count",
|
||||
"can_delete_all_posts",
|
||||
"can_be_deleted",
|
||||
"can_be_anonymized",
|
||||
"can_be_merged",
|
||||
"full_suspend_reason",
|
||||
"silence_reason",
|
||||
"primary_group_id",
|
||||
"badge_count",
|
||||
"warnings_received_count",
|
||||
|
|
|
@ -315,31 +315,27 @@ RSpec.describe "users" do
|
|||
end
|
||||
|
||||
path "/admin/users/{id}.json" do
|
||||
# TODO @blake / @sam - this is not passing cause "silence_reason" is a conditional attribute
|
||||
# (also can_be_deleted is) - we need to figure out how to not include it in the schema - it is not included
|
||||
# in the admin response by design
|
||||
#
|
||||
# get "Get a user by id" do
|
||||
# tags "Users", "Admin"
|
||||
# operationId "adminGetUser"
|
||||
# consumes "application/json"
|
||||
# expected_request_schema = nil
|
||||
get "Get a user by id" do
|
||||
tags "Users", "Admin"
|
||||
operationId "adminGetUser"
|
||||
consumes "application/json"
|
||||
expected_request_schema = nil
|
||||
|
||||
# parameter name: :id, in: :path, type: :integer, required: true
|
||||
parameter name: :id, in: :path, type: :integer, required: true
|
||||
|
||||
# produces "application/json"
|
||||
# response "200", "response" do
|
||||
# let(:id) { Fabricate(:user).id }
|
||||
produces "application/json"
|
||||
response "200", "response" do
|
||||
let(:id) { Fabricate(:user).id }
|
||||
|
||||
# expected_response_schema = load_spec_schema("admin_user_response")
|
||||
# schema(expected_response_schema)
|
||||
expected_response_schema = load_spec_schema("admin_user_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
|
||||
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
|
||||
|
||||
delete "Delete a user" do
|
||||
tags "Users", "Admin"
|
||||
|
|
Loading…
Reference in New Issue
Block a user