From c2afc8a27ce90a7d316dff52a82818b891ffda5b Mon Sep 17 00:00:00 2001 From: Peter Bouda Date: Tue, 15 Oct 2024 10:48:00 +0100 Subject: [PATCH] DEV: Add test for user deletion --- spec/integration/users_spec.rb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/spec/integration/users_spec.rb b/spec/integration/users_spec.rb index 59890f5..8cd7c6d 100644 --- a/spec/integration/users_spec.rb +++ b/spec/integration/users_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe "User SCIM endpoint" do +describe "User SCIM endpoints" do before do SiteSetting.chat_enabled = true SiteSetting.chat_allowed_groups = Group::AUTO_GROUPS[:everyone] @@ -92,4 +92,16 @@ describe "User SCIM endpoint" do response_content = JSON.parse(response.body) expect(response_content["displayName"]).to eq("Changed Name") 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