feat: update users on SAML setup and destroy [CW-2958][CW-5612] (#12346)

This commit is contained in:
Shivam Mishra
2025-09-15 21:20:22 +05:30
committed by GitHub
parent 458ed1e26d
commit 7a453f50f4
6 changed files with 184 additions and 0 deletions

View File

@@ -114,4 +114,21 @@ RSpec.describe AccountSamlSettings, type: :model do
expect(fingerprint.count(':')).to eq(19) # 20 bytes = 19 colons
end
end
describe 'callbacks' do
describe 'after_create_commit' do
it 'queues job to set account users to saml provider' do
expect(Saml::UpdateAccountUsersProviderJob).to receive(:perform_later).with(account.id, 'saml')
create(:account_saml_settings, account: account)
end
end
describe 'after_destroy_commit' do
it 'queues job to reset account users provider' do
settings = create(:account_saml_settings, account: account)
expect(Saml::UpdateAccountUsersProviderJob).to receive(:perform_later).with(account.id, 'email')
settings.destroy
end
end
end
end