bug(user.fcis): users using more than one FranceConnect identity provider can not be destroyed
This commit is contained in:
parent
a247ec6c12
commit
b468da9964
2 changed files with 13 additions and 0 deletions
|
@ -12,5 +12,9 @@ FactoryBot.define do
|
|||
trait :with_strong_password do
|
||||
password { '{my-%s3cure[]-p4$$w0rd' }
|
||||
end
|
||||
|
||||
trait :with_fci do
|
||||
association :france_connect_information
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -354,6 +354,15 @@ describe User, type: :model do
|
|||
expect(User.find_by(id: user.id)).to be_nil
|
||||
end
|
||||
end
|
||||
|
||||
context 'with fci' do
|
||||
let(:user) { create(:user, :with_fci) }
|
||||
let!(:fci) { create(:france_connect_information, user:) }
|
||||
let(:reason) { :user_expired }
|
||||
subject { user.delete_and_keep_track_dossiers_also_delete_user(super_admin, reason:) }
|
||||
|
||||
it { expect { subject }.not_to raise_error }
|
||||
end
|
||||
end
|
||||
|
||||
describe '#password_complexity' do
|
||||
|
|
Loading…
Add table
Reference in a new issue