Merge pull request #3162 from maatinito/issue/249_too_short_password_test

[#249] added test for too short passwords
This commit is contained in:
Pierre de La Morinerie 2018-12-18 10:31:06 +01:00 committed by GitHub
commit dcb452d7e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,6 @@
require 'spec_helper' require 'spec_helper'
feature 'Signin up:' do feature 'Signing up:' do
let(:user_email) { generate :user_email } let(:user_email) { generate :user_email }
let(:user_password) { 'testpassword' } let(:user_password) { 'testpassword' }
@ -17,6 +17,22 @@ feature 'Signin up:' do
expect(page).to have_current_path dossiers_path expect(page).to have_current_path dossiers_path
end end
scenario 'a new user cant sign-up with too short password' do
visit root_path
click_on 'Connexion'
click_on 'Créer un compte'
expect(page).to have_current_path new_user_registration_path
sign_up_with user_email, '1234567'
expect(page).to have_current_path user_registration_path
expect(page).to have_content 'Le mot de passe est trop court'
# Then with a good password
sign_up_with user_email, user_password
expect(page).to have_current_path new_user_confirmation_path user: { email: user_email }
expect(page).to have_content "nous avons besoin de vérifier votre adresse #{user_email}"
end
context 'when visiting a procedure' do context 'when visiting a procedure' do
let(:procedure) { create :simple_procedure } let(:procedure) { create :simple_procedure }