diff --git a/app/controllers/users/dossiers_controller.rb b/app/controllers/users/dossiers_controller.rb index e6a64f2cd..592f16f2c 100644 --- a/app/controllers/users/dossiers_controller.rb +++ b/app/controllers/users/dossiers_controller.rb @@ -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') diff --git a/spec/controllers/users/dossiers_controller_spec.rb b/spec/controllers/users/dossiers_controller_spec.rb index 8dd165c01..8d3b702f9 100644 --- a/spec/controllers/users/dossiers_controller_spec.rb +++ b/spec/controllers/users/dossiers_controller_spec.rb @@ -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