feat(User): verify mandat email during creation
This commit is contained in:
parent
dbf6459b4b
commit
1cf9535bea
2 changed files with 3 additions and 0 deletions
|
@ -149,6 +149,8 @@ module Users
|
||||||
@no_description = true
|
@no_description = true
|
||||||
|
|
||||||
if @dossier.update(dossier_params) && @dossier.individual.valid?
|
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)
|
@dossier.update!(autorisation_donnees: true, identity_updated_at: Time.zone.now)
|
||||||
flash.notice = t('.identity_saved')
|
flash.notice = t('.identity_saved')
|
||||||
|
|
||||||
|
|
|
@ -211,6 +211,7 @@ describe Users::DossiersController, type: :controller do
|
||||||
expect(individual.errors.full_messages).to be_empty
|
expect(individual.errors.full_messages).to be_empty
|
||||||
expect(individual.notification_method).to eq('email')
|
expect(individual.notification_method).to eq('email')
|
||||||
expect(individual.email).to eq('mickey@gmail.com')
|
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))
|
expect(response).to redirect_to(brouillon_dossier_path(dossier))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue