diff --git a/spec/system/france_connect/france_connect_particulier_spec.rb b/spec/system/france_connect/france_connect_particulier_spec.rb index cfea467cf..e6fdb5786 100644 --- a/spec/system/france_connect/france_connect_particulier_spec.rb +++ b/spec/system/france_connect/france_connect_particulier_spec.rb @@ -43,22 +43,24 @@ describe 'France Connect Particulier Connexion' do before { page.find('.fr-connect').click } scenario 'he is redirected to user dossiers page' do - expect(page).to have_content("Choisissez votre e-mail de contact") - find('#use_fc_email').click - expect(page).to have_content("Confirmation envoyée") + expect(page).to have_content("Choisissez votre email de contact pour finaliser votre connexion") + find("#use_france_connect_email_no").click + fill_in("email", with: "exemple@email.com") + page.find("input[type='submit'][name='commit'][value='Confirmer']").click + expect(page).to have_content("Confirmez votre email") click_on 'Continuer' expect(User.find_by(email: email)).not_to be nil end scenario 'he can choose not to use FranceConnect email and input an alternative email' do - expect(page).to have_content("Choisissez votre e-mail de contact") + expect(page).to have_content("Choisissez votre email de contact pour finaliser votre connexion") expect(page).to have_selector("input[name='email']", visible: true, wait: 10) fill_in 'email', with: 'alternative@example.com' click_on 'Confirmer' - expect(page).to have_content("Nous venons de vous envoyer le mail de confirmation") + expect(page).to have_content("Confirmez votre email") end end diff --git a/spec/system/users/dossier_prefill_get_spec.rb b/spec/system/users/dossier_prefill_get_spec.rb index 6333f617e..a53d50a23 100644 --- a/spec/system/users/dossier_prefill_get_spec.rb +++ b/spec/system/users/dossier_prefill_get_spec.rb @@ -191,12 +191,12 @@ describe 'Prefilling a dossier (with a GET request):', js: true do page.find('.fr-connect').click - expect(page).to have_content("Choisissez votre e-mail de contact") - expect(page).to have_selector("#use_fc_email", visible: false, wait: 10) - page.execute_script('document.getElementById("use_fc_email").click()') - - expect(page).to have_content("Confirmation envoyée") - + expect(page).to have_content("Choisissez votre email de contact pour finaliser votre connexion") + expect(page).to have_selector("#use_france_connect_email_no", visible: false, wait: 10) + page.execute_script('document.getElementById("use_france_connect_email_no").click()') + fill_in("email", with: "exemple@email.com") + page.find("input[type='submit'][name='commit'][value='Confirmer']").click + expect(page).to have_content("Confirmez votre email") click_on 'Continuer' expect(page).to have_content('Vous avez un dossier prérempli') find('.fr-btn.fr-mb-2w', text: 'Poursuivre mon dossier prérempli', wait: 10).click diff --git a/spec/system/users/dossier_prefill_post_spec.rb b/spec/system/users/dossier_prefill_post_spec.rb index 0ca1baf1c..9ae750962 100644 --- a/spec/system/users/dossier_prefill_post_spec.rb +++ b/spec/system/users/dossier_prefill_post_spec.rb @@ -142,12 +142,12 @@ describe 'Prefilling a dossier (with a POST request):', js: true do allow(FranceConnectService).to receive(:retrieve_user_informations_particulier).and_return(build(:france_connect_information)) page.find('.fr-connect').click - expect(page).to have_content("Choisissez votre e-mail de contact") + expect(page).to have_content("Choisissez votre email de contact pour finaliser votre connexion") expect(page).to have_selector("#use_france_connect_email_yes", visible: false, wait: 10) page.execute_script('document.getElementById("use_france_connect_email_yes").click()') click_on 'Confirmer' - expect(page).to have_content("Confirmation envoyée") + expect(page).to have_content("Confirmez votre email") click_on 'Continuer' expect(page).to have_content('Vous avez un dossier prérempli') find('.fr-btn.fr-mb-2w', text: 'Poursuivre mon dossier prérempli', wait: 10).click