diff --git a/config/initializers/zxcvbn.rb b/config/initializers/zxcvbn.rb index 8e9015fe6..8b4e0039f 100644 --- a/config/initializers/zxcvbn.rb +++ b/config/initializers/zxcvbn.rb @@ -8,5 +8,4 @@ new_ranked_dictionary = new_frequency_lists.transform_values do |lst| Zxcvbn::Matching.build_ranked_dict(lst) end -# Zxcvbn::Matching::RANKED_DICTIONARIES.merge! new_ranked_dictionary -Zxcvbn::Matching::RANKED_DICTIONARIES = new_ranked_dictionary +Zxcvbn::Matching::RANKED_DICTIONARIES.merge! new_ranked_dictionary diff --git a/spec/controllers/administrateurs/activate_controller_spec.rb b/spec/controllers/administrateurs/activate_controller_spec.rb index 9de80460c..524113e77 100644 --- a/spec/controllers/administrateurs/activate_controller_spec.rb +++ b/spec/controllers/administrateurs/activate_controller_spec.rb @@ -37,7 +37,7 @@ describe Administrateurs::ActivateController, type: :controller do end context 'when the password is not strong' do - let(:password) { 'another-password-ok?' } + let(:password) { 'password-ok?' } it { expect(administrateur.user.reload.valid_password?(password)).to be false } it { expect(response).to redirect_to(admin_activate_path(token: token)) } diff --git a/spec/support/system_helpers.rb b/spec/support/system_helpers.rb index 3b302edd7..e68926aed 100644 --- a/spec/support/system_helpers.rb +++ b/spec/support/system_helpers.rb @@ -61,7 +61,7 @@ module SystemHelpers confirmation_email = open_email(email) procedure_sign_in_link = confirmation_email.body.match(/href="([^"]*\/commencer\/[^"]*)"/)[1] - visit procedure_sign_in_link + visit URI.parse(procedure_sign_in_link).path end def click_reset_password_link_for(email) diff --git a/spec/system/administrateurs/admin_creation_spec.rb b/spec/system/administrateurs/admin_creation_spec.rb index 18e29e59d..4cc21cb90 100644 --- a/spec/system/administrateurs/admin_creation_spec.rb +++ b/spec/system/administrateurs/admin_creation_spec.rb @@ -4,7 +4,7 @@ describe 'As an administrateur', js: true do let(:super_admin) { create(:super_admin) } let(:admin_email) { 'new_admin@gouv.fr' } let(:new_admin) { Administrateur.by_email(admin_email) } - let(:weak_password) { '12345678' } + let(:weak_password) { '000000000000' } let(:strong_password) { 'a new, long, and complicated password!' } before do diff --git a/spec/system/experts/expert_spec.rb b/spec/system/experts/expert_spec.rb index 778a1932a..7ad4e7685 100644 --- a/spec/system/experts/expert_spec.rb +++ b/spec/system/experts/expert_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe 'Inviting an expert:' do +describe 'Inviting an expert:', js: true do include ActiveJob::TestHelper include ActionView::Helpers @@ -34,7 +34,8 @@ describe 'Inviting an expert:' do end scenario 'I can sign-in again afterwards' do - click_on 'Se déconnecter' + click_on(avis.expert.email.to_s, visible: true) + click_on('Se déconnecter', visible: true) visit new_user_session_path sign_in_with avis.expert.email, password @@ -54,9 +55,10 @@ describe 'Inviting an expert:' do expect(page).to have_current_path(new_user_session_path) login_as avis.expert.user, scope: :user - sign_in_with(avis.expert.email, 'This is a very complicated password !') + sign_in_with(avis.expert.email, '{My-$3cure-p4ssWord}') expect(page).to have_content("connecté en tant qu’expert") - click_on 'Passer en usager' + click_on(avis.expert.email.to_s, visible: true) + click_on('Passer en usager', visible: true) expect(page).to have_current_path(dossiers_path) end end @@ -111,10 +113,11 @@ describe 'Inviting an expert:' do expect(page).to have_text('Cet avis est confidentiel') # check validation + fill_in 'avis_answer', with: 'Ma réponse d’expert.' click_on 'Envoyer votre avis' expect(page).to have_content("Le champ « Réponse oui/non » n'est pas inclus(e) dans la liste") - choose 'non' + find('label', text: 'non').click fill_in 'avis_answer', with: 'Ma réponse d’expert.' click_on 'Envoyer votre avis'