fixe les tests suite au changement de wording sur les layouts
This commit is contained in:
parent
ff88a0a2a6
commit
0b4a9bb3bb
3 changed files with 15 additions and 13 deletions
|
@ -43,22 +43,24 @@ describe 'France Connect Particulier Connexion' do
|
||||||
before { page.find('.fr-connect').click }
|
before { page.find('.fr-connect').click }
|
||||||
|
|
||||||
scenario 'he is redirected to user dossiers page' do
|
scenario 'he is redirected to user dossiers page' 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")
|
||||||
find('#use_fc_email').click
|
find("#use_france_connect_email_no").click
|
||||||
expect(page).to have_content("Confirmation envoyée")
|
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'
|
click_on 'Continuer'
|
||||||
expect(User.find_by(email: email)).not_to be nil
|
expect(User.find_by(email: email)).not_to be nil
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'he can choose not to use FranceConnect email and input an alternative email' do
|
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)
|
expect(page).to have_selector("input[name='email']", visible: true, wait: 10)
|
||||||
|
|
||||||
fill_in 'email', with: 'alternative@example.com'
|
fill_in 'email', with: 'alternative@example.com'
|
||||||
click_on 'Confirmer'
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -191,12 +191,12 @@ describe 'Prefilling a dossier (with a GET request):', js: true do
|
||||||
|
|
||||||
page.find('.fr-connect').click
|
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_fc_email", visible: false, wait: 10)
|
expect(page).to have_selector("#use_france_connect_email_no", visible: false, wait: 10)
|
||||||
page.execute_script('document.getElementById("use_fc_email").click()')
|
page.execute_script('document.getElementById("use_france_connect_email_no").click()')
|
||||||
|
fill_in("email", with: "exemple@email.com")
|
||||||
expect(page).to have_content("Confirmation envoyée")
|
page.find("input[type='submit'][name='commit'][value='Confirmer']").click
|
||||||
|
expect(page).to have_content("Confirmez votre email")
|
||||||
click_on 'Continuer'
|
click_on 'Continuer'
|
||||||
expect(page).to have_content('Vous avez un dossier prérempli')
|
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
|
find('.fr-btn.fr-mb-2w', text: 'Poursuivre mon dossier prérempli', wait: 10).click
|
||||||
|
|
|
@ -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))
|
allow(FranceConnectService).to receive(:retrieve_user_informations_particulier).and_return(build(:france_connect_information))
|
||||||
|
|
||||||
page.find('.fr-connect').click
|
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)
|
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()')
|
page.execute_script('document.getElementById("use_france_connect_email_yes").click()')
|
||||||
|
|
||||||
click_on 'Confirmer'
|
click_on 'Confirmer'
|
||||||
expect(page).to have_content("Confirmation envoyée")
|
expect(page).to have_content("Confirmez votre email")
|
||||||
click_on 'Continuer'
|
click_on 'Continuer'
|
||||||
expect(page).to have_content('Vous avez un dossier prérempli')
|
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
|
find('.fr-btn.fr-mb-2w', text: 'Poursuivre mon dossier prérempli', wait: 10).click
|
||||||
|
|
Loading…
Reference in a new issue