feat(User): verify mandat email during creation

This commit is contained in:
simon lehericey 2024-05-27 11:22:52 +02:00
parent dbf6459b4b
commit 1cf9535bea
No known key found for this signature in database
GPG key ID: CDE670D827C7B3C5
2 changed files with 3 additions and 0 deletions

View file

@ -149,6 +149,8 @@ module Users
@no_description = true
if @dossier.update(dossier_params) && @dossier.individual.valid?
# TODO: remove this after proper mandat email validation
@dossier.individual.update!(email_verified_at: Time.zone.now)
@dossier.update!(autorisation_donnees: true, identity_updated_at: Time.zone.now)
flash.notice = t('.identity_saved')

View file

@ -211,6 +211,7 @@ describe Users::DossiersController, type: :controller do
expect(individual.errors.full_messages).to be_empty
expect(individual.notification_method).to eq('email')
expect(individual.email).to eq('mickey@gmail.com')
expect(individual.email_verified_at).to be_present
expect(response).to redirect_to(brouillon_dossier_path(dossier))
end