Merge pull request #11074 from demarches-simplifiees/fix_unverified_email

ETQ Usager, je veux recevoir des mails !
This commit is contained in:
LeSim 2024-11-25 08:06:00 +00:00 committed by GitHub
commit b8ad6f44f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 0 deletions

View file

@ -61,6 +61,7 @@ class User < ApplicationRecord
# Callback provided by Devise
def after_confirmation
update!(email_verified_at: Time.zone.now)
link_invites!
end

View file

@ -10,9 +10,11 @@ describe 'Signing up:', js: true do
sign_up_with user_email, user_password
expect(page).to have_content "nous avons besoin de vérifier votre adresse électronique #{user_email}"
expect(User.find_by(email: user_email).email_verified_at).to be_nil
click_confirmation_link_for user_email
expect(page).to have_content('Votre compte a bien été confirmé.')
expect(User.find_by(email: user_email).email_verified_at).to be_present
expect(page).to have_current_path dossiers_path
end