DEV: Add test for user deletion

This commit is contained in:
Peter Bouda 2024-10-15 10:48:00 +01:00
parent f8aaa2a039
commit c2afc8a27c

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
describe "User SCIM endpoint" do describe "User SCIM endpoints" do
before do before do
SiteSetting.chat_enabled = true SiteSetting.chat_enabled = true
SiteSetting.chat_allowed_groups = Group::AUTO_GROUPS[:everyone] SiteSetting.chat_allowed_groups = Group::AUTO_GROUPS[:everyone]
@ -92,4 +92,16 @@ describe "User SCIM endpoint" do
response_content = JSON.parse(response.body) response_content = JSON.parse(response.body)
expect(response_content["displayName"]).to eq("Changed Name") expect(response_content["displayName"]).to eq("Changed Name")
end end
it "can delete a user" do
create_user
response_content = JSON.parse(response.body)
delete "/scim_v2/Users/#{response_content["id"]}",
headers: {
"Authorization" => "Bearer " + scim_api_key.key,
"Content-Type" => "application/scim+json"
},
as: :json
expect(response.status).to eq(204)
end
end end