users: add integration tests for sign-up
This commit is contained in:
parent
b0541fba79
commit
8355b690f0
1 changed files with 36 additions and 0 deletions
36
spec/features/sessions/sign_up_spec.rb
Normal file
36
spec/features/sessions/sign_up_spec.rb
Normal file
|
@ -0,0 +1,36 @@
|
|||
require 'spec_helper'
|
||||
|
||||
feature 'Signin up:' do
|
||||
scenario 'a new user can sign-up' do
|
||||
visit root_path
|
||||
click_on 'Connexion'
|
||||
click_on 'Créer un compte'
|
||||
|
||||
sign_up_with 'testuser@exemple.fr'
|
||||
expect(page).to have_content "Nous vous avons envoyé un email contenant un lien d'activation"
|
||||
|
||||
click_confirmation_link_for 'testuser@exemple.fr'
|
||||
expect(page).to have_content 'Votre compte a été activé'
|
||||
expect(page).to have_current_path dossiers_path
|
||||
end
|
||||
|
||||
context 'when visiting a procedure' do
|
||||
let(:procedure) { create :simple_procedure }
|
||||
|
||||
before do
|
||||
visit commencer_path(path: procedure.path)
|
||||
end
|
||||
|
||||
scenario 'a new user can sign-up and fill the procedure' do
|
||||
expect(page).to have_current_path new_user_session_path
|
||||
click_on 'Créer un compte'
|
||||
|
||||
sign_up_with 'testuser@exemple.fr'
|
||||
expect(page).to have_content "Nous vous avons envoyé un email contenant un lien d'activation"
|
||||
|
||||
click_confirmation_link_for 'testuser@exemple.fr'
|
||||
expect(page).to have_content 'Votre compte a été activé'
|
||||
expect(page).to have_content procedure.libelle
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue