Merge pull request #3162 from maatinito/issue/249_too_short_password_test
[#249] added test for too short passwords
This commit is contained in:
commit
dcb452d7e6
1 changed files with 17 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
|||
require 'spec_helper'
|
||||
|
||||
feature 'Signin up:' do
|
||||
feature 'Signing up:' do
|
||||
let(:user_email) { generate :user_email }
|
||||
let(:user_password) { 'testpassword' }
|
||||
|
||||
|
@ -17,6 +17,22 @@ feature 'Signin up:' do
|
|||
expect(page).to have_current_path dossiers_path
|
||||
end
|
||||
|
||||
scenario 'a new user can’t 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
|
||||
let(:procedure) { create :simple_procedure }
|
||||
|
||||
|
|
Loading…
Reference in a new issue