From 7eee9beed7fc77147e83db57dd6365ed66e724d5 Mon Sep 17 00:00:00 2001 From: Judith Date: Tue, 1 Sep 2020 15:28:31 +0200 Subject: [PATCH] adapting the specs --- config/locales/en.yml | 2 +- spec/controllers/users/profil_controller_spec.rb | 2 +- spec/controllers/users/sessions_controller_spec.rb | 2 +- spec/features/sessions/sign_in_spec.rb | 2 +- spec/features/users/invite_spec.rb | 2 +- spec/features/users/managing_password_spec.rb | 8 ++++---- spec/features/users/sign_up_spec.rb | 6 +++--- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index e45800715..ee24bb44a 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -132,7 +132,7 @@ en: # parcelles_agricoles_empty: # one: "Aucune parcelle agricole sur la zone sélectionnée" # other: "Aucune parcelle agricole sur les zones sélectionnées" - not_an_integer: "must be an integer (without any digit after the comma)" + not_an_integer: "must be an integer (without decimal)" blank: "can't be blank" time: diff --git a/spec/controllers/users/profil_controller_spec.rb b/spec/controllers/users/profil_controller_spec.rb index 2d79fca85..cf163ba93 100644 --- a/spec/controllers/users/profil_controller_spec.rb +++ b/spec/controllers/users/profil_controller_spec.rb @@ -56,7 +56,7 @@ describe Users::ProfilController, type: :controller do end it { expect(response).to redirect_to(profil_path) } - it { expect(flash.alert).to eq(['Email invalide']) } + it { expect(flash.alert).to eq(['Courriel invalide']) } end context 'when the user has an instructeur role' do diff --git a/spec/controllers/users/sessions_controller_spec.rb b/spec/controllers/users/sessions_controller_spec.rb index 7734b9538..e9ca9fcee 100644 --- a/spec/controllers/users/sessions_controller_spec.rb +++ b/spec/controllers/users/sessions_controller_spec.rb @@ -62,7 +62,7 @@ describe Users::SessionsController, type: :controller do subject expect(response).to render_template(:new) - expect(flash.alert).to eq(I18n.t('devise.failure.invalid')) + expect(flash.alert).to eq('Courriel ou mot de passe incorrect.') end end end diff --git a/spec/features/sessions/sign_in_spec.rb b/spec/features/sessions/sign_in_spec.rb index b97980d6a..84361db70 100644 --- a/spec/features/sessions/sign_in_spec.rb +++ b/spec/features/sessions/sign_in_spec.rb @@ -60,7 +60,7 @@ feature 'Signin in:' do click_on 'Connexion' sign_in_with user.email, password - expect(page).to have_content 'Vous devez confirmer votre adresse email pour continuer' + expect(page).to have_content('Vous devez confirmer votre compte par courriel.') end end end diff --git a/spec/features/users/invite_spec.rb b/spec/features/users/invite_spec.rb index 9ca3c6217..e78fef219 100644 --- a/spec/features/users/invite_spec.rb +++ b/spec/features/users/invite_spec.rb @@ -41,7 +41,7 @@ feature 'Invitations' do # Confirm the account # (The user should be redirected to the dossier they was invited on) click_confirmation_link_for invite.email - expect(page).to have_content('Votre compte a été activé') + expect(page).to have_content('Votre compte a bien été confirmé.') expect(page).to have_current_path(brouillon_dossier_path(dossier)) end end diff --git a/spec/features/users/managing_password_spec.rb b/spec/features/users/managing_password_spec.rb index 52aa4c109..96ee9bdd5 100644 --- a/spec/features/users/managing_password_spec.rb +++ b/spec/features/users/managing_password_spec.rb @@ -13,7 +13,7 @@ feature 'Managing password:' do perform_enqueued_jobs do click_on 'Réinitialiser' end - expect(page).to have_content 'vous allez recevoir un lien de réinitialisation par email' + expect(page).to have_content('Si votre courriel existe dans notre base de données, vous recevrez un lien vous permettant de récupérer votre mot de passe.') click_reset_password_link_for user.email expect(page).to have_content 'Changement de mot de passe' @@ -21,7 +21,7 @@ feature 'Managing password:' do fill_in 'user_password', with: new_password fill_in 'user_password_confirmation', with: new_password click_on 'Changer le mot de passe' - expect(page).to have_content('Votre mot de passe a été changé avec succès') + expect(page).to have_content('Votre mot de passe a bien été modifié.') end end @@ -40,7 +40,7 @@ feature 'Managing password:' do perform_enqueued_jobs do click_on 'Réinitialiser' end - expect(page).to have_content 'vous allez recevoir un lien de réinitialisation par email' + expect(page).to have_content('Si votre courriel existe dans notre base de données, vous recevrez un lien vous permettant de récupérer votre mot de passe.') click_reset_password_link_for user.email @@ -49,7 +49,7 @@ feature 'Managing password:' do fill_in 'user_password', with: new_password fill_in 'user_password_confirmation', with: new_password click_on 'Changer le mot de passe' - expect(page).to have_content('Votre mot de passe a été changé avec succès') + expect(page).to have_content('Votre mot de passe a bien été modifié.') end end end diff --git a/spec/features/users/sign_up_spec.rb b/spec/features/users/sign_up_spec.rb index 65182a303..000a7a3b4 100644 --- a/spec/features/users/sign_up_spec.rb +++ b/spec/features/users/sign_up_spec.rb @@ -10,7 +10,7 @@ feature 'Signing up:' do expect(page).to have_content "nous avons besoin de vérifier votre adresse #{user_email}" click_confirmation_link_for user_email - expect(page).to have_content 'Votre compte a été activé' + expect(page).to have_content('Votre compte a bien été confirmé.') expect(page).to have_current_path dossiers_path end @@ -80,7 +80,7 @@ feature 'Signing up:' do # After confirmation, the user is redirected to the procedure they were initially starting # (even when confirming the account in another browser). expect(page).to have_current_path(commencer_path(path: procedure.path)) - expect(page).to have_content 'Votre compte a été activé' + expect(page).to have_content I18n.t('devise.confirmations.confirmed') click_on 'Commencer la démarche' expect(page).to have_current_path identite_dossier_path(procedure.reload.dossiers.last) @@ -112,7 +112,7 @@ feature 'Signing up:' do # After confirmation, the user is redirected to the procedure they were initially starting # (even when confirming the account in another browser). expect(page).to have_current_path(commencer_path(path: procedure.path)) - expect(page).to have_content 'Votre compte a été activé' + expect(page).to have_content I18n.t('devise.confirmations.confirmed') expect(page).to have_content 'Commencer la démarche' end end