New signup test
Signed-off-by: Chaïb Martinez <chaibax@gmail.com>
This commit is contained in:
parent
5f20d657d0
commit
8ad79d3235
1 changed files with 9 additions and 11 deletions
|
@ -3,24 +3,23 @@ require 'spec_helper'
|
||||||
feature 'Signing up:' do
|
feature 'Signing up:' do
|
||||||
let(:user_email) { generate :user_email }
|
let(:user_email) { generate :user_email }
|
||||||
let(:user_password) { 'démarches-simplifiées-pwd' }
|
let(:user_password) { 'démarches-simplifiées-pwd' }
|
||||||
|
let(:procedure) { create :simple_procedure, :with_service }
|
||||||
|
|
||||||
scenario 'a new user can sign-up' do
|
scenario 'a new user can sign-up' do
|
||||||
visit root_path
|
visit commencer_path(path: procedure.path)
|
||||||
click_on 'Connexion'
|
click_on 'Créer un compte demarches-simplifiees.fr'
|
||||||
click_on 'Créer un compte'
|
|
||||||
|
|
||||||
sign_up_with user_email, user_password
|
sign_up_with user_email, user_password
|
||||||
expect(page).to have_content "nous avons besoin de vérifier votre adresse #{user_email}"
|
expect(page).to have_content "nous avons besoin de vérifier votre adresse #{user_email}"
|
||||||
|
|
||||||
click_confirmation_link_for 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 été activé'
|
||||||
expect(page).to have_current_path dossiers_path
|
expect(page).to have_current_path commencer_path(path: procedure.path)
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'a new user can’t sign-up with too short password' do
|
scenario 'a new user can’t sign-up with too short password when visiting a procedure' do
|
||||||
visit root_path
|
visit commencer_path(path: procedure.path)
|
||||||
click_on 'Connexion'
|
click_on 'Créer un compte demarches-simplifiees.fr'
|
||||||
click_on 'Créer un compte'
|
|
||||||
|
|
||||||
expect(page).to have_current_path new_user_registration_path
|
expect(page).to have_current_path new_user_registration_path
|
||||||
sign_up_with user_email, '1234567'
|
sign_up_with user_email, '1234567'
|
||||||
|
@ -61,9 +60,8 @@ feature 'Signing up:' do
|
||||||
|
|
||||||
context 'when a user is not confirmed yet' do
|
context 'when a user is not confirmed yet' do
|
||||||
before do
|
before do
|
||||||
visit root_path
|
visit commencer_path(path: procedure.path)
|
||||||
click_on 'Connexion'
|
click_on 'Créer un compte demarches-simplifiees.fr'
|
||||||
click_on 'Créer un compte'
|
|
||||||
|
|
||||||
sign_up_with user_email, user_password
|
sign_up_with user_email, user_password
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue