fix: user confirming their mail have its email verified

This commit is contained in:
simon lehericey 2024-11-22 18:48:57 +01:00
parent a73e3e8e76
commit c3af718f1c
No known key found for this signature in database
GPG key ID: CDE670D827C7B3C5
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