mirror of
https://github.com/discourse/discourse.git
synced 2025-01-16 05:42: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",
|
"flags_received_count",
|
||||||
"private_topics_count",
|
"private_topics_count",
|
||||||
"can_delete_all_posts",
|
"can_delete_all_posts",
|
||||||
"can_be_deleted",
|
|
||||||
"can_be_anonymized",
|
"can_be_anonymized",
|
||||||
"can_be_merged",
|
"can_be_merged",
|
||||||
"full_suspend_reason",
|
"full_suspend_reason",
|
||||||
"silence_reason",
|
|
||||||
"primary_group_id",
|
"primary_group_id",
|
||||||
"badge_count",
|
"badge_count",
|
||||||
"warnings_received_count",
|
"warnings_received_count",
|
||||||
|
|
|
@ -315,31 +315,27 @@ RSpec.describe "users" do
|
||||||
end
|
end
|
||||||
|
|
||||||
path "/admin/users/{id}.json" do
|
path "/admin/users/{id}.json" do
|
||||||
# TODO @blake / @sam - this is not passing cause "silence_reason" is a conditional attribute
|
get "Get a user by id" do
|
||||||
# (also can_be_deleted is) - we need to figure out how to not include it in the schema - it is not included
|
tags "Users", "Admin"
|
||||||
# in the admin response by design
|
operationId "adminGetUser"
|
||||||
#
|
consumes "application/json"
|
||||||
# get "Get a user by id" do
|
expected_request_schema = nil
|
||||||
# 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"
|
produces "application/json"
|
||||||
# response "200", "response" do
|
response "200", "response" do
|
||||||
# let(:id) { Fabricate(:user).id }
|
let(:id) { Fabricate(:user).id }
|
||||||
|
|
||||||
# expected_response_schema = load_spec_schema("admin_user_response")
|
expected_response_schema = load_spec_schema("admin_user_response")
|
||||||
# schema(expected_response_schema)
|
schema(expected_response_schema)
|
||||||
|
|
||||||
# it_behaves_like "a JSON endpoint", 200 do
|
it_behaves_like "a JSON endpoint", 200 do
|
||||||
# let(:expected_response_schema) { expected_response_schema }
|
let(:expected_response_schema) { expected_response_schema }
|
||||||
# let(:expected_request_schema) { expected_request_schema }
|
let(:expected_request_schema) { expected_request_schema }
|
||||||
# end
|
end
|
||||||
# end
|
end
|
||||||
# end
|
end
|
||||||
|
|
||||||
delete "Delete a user" do
|
delete "Delete a user" do
|
||||||
tags "Users", "Admin"
|
tags "Users", "Admin"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user