commencer: add an independant page
This commit is contained in:
parent
bd77f82df0
commit
016e5f2e6f
14 changed files with 252 additions and 42 deletions
|
@ -14,10 +14,12 @@ feature 'The gestionnaire part' do
|
|||
|
||||
scenario 'a gestionnaire can fill a dossier' do
|
||||
visit commencer_path(path: procedure.path)
|
||||
click_on 'J’ai déjà un compte'
|
||||
|
||||
expect(page).to have_current_path new_user_session_path
|
||||
sign_in_with(gestionnaire.email, password, true)
|
||||
|
||||
expect(page).to have_current_path(siret_dossier_path(procedure.reload.dossiers.last))
|
||||
expect(page).to have_content(procedure.libelle)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -130,6 +130,8 @@ feature 'The user' do
|
|||
|
||||
def log_in(email, password, procedure)
|
||||
visit "/commencer/#{procedure.path}"
|
||||
click_on 'J’ai déjà un compte'
|
||||
|
||||
expect(page).to have_current_path(new_user_session_path)
|
||||
|
||||
fill_in 'user_email', with: email
|
||||
|
|
|
@ -17,10 +17,10 @@ feature 'Creating a new dossier:' do
|
|||
|
||||
before do
|
||||
visit commencer_path(path: procedure.path)
|
||||
click_on 'Commencer la démarche'
|
||||
|
||||
expect(page).to have_content(procedure.libelle)
|
||||
expect(page).to have_content(procedure.description)
|
||||
expect(page).to have_content(procedure.service.email)
|
||||
expect(page).to have_current_path identite_dossier_path(user.reload.dossiers.last)
|
||||
expect_page_to_have_procedure_description(procedure)
|
||||
|
||||
fill_in 'individual_nom', with: 'Nom'
|
||||
fill_in 'individual_prenom', with: 'Prenom'
|
||||
|
@ -77,13 +77,12 @@ feature 'Creating a new dossier:' do
|
|||
.to_return(status: 404, body: '')
|
||||
end
|
||||
|
||||
scenario 'the user can enter the SIRET of its etablissement and create a new draft', vcr: { cassette_name: 'api_adresse_search_paris_3' }, js: true do
|
||||
scenario 'the user can enter the SIRET of its etablissement and create a new draft', vcr: { cassette_name: 'api_adresse_search_paris_3' } do
|
||||
visit commencer_path(path: procedure.path)
|
||||
click_on 'Commencer la démarche'
|
||||
|
||||
expect(page).to have_current_path(siret_dossier_path(dossier))
|
||||
expect(page).to have_content(procedure.libelle)
|
||||
expect(page).to have_content(procedure.description)
|
||||
expect(page).to have_content(procedure.service.email)
|
||||
expect(page).to have_current_path siret_dossier_path(dossier)
|
||||
expect_page_to_have_procedure_description(procedure)
|
||||
|
||||
fill_in 'Numéro SIRET', with: siret
|
||||
click_on 'Valider'
|
||||
|
@ -97,7 +96,10 @@ feature 'Creating a new dossier:' do
|
|||
|
||||
scenario 'the user is notified when its SIRET is invalid' do
|
||||
visit commencer_path(path: procedure.path)
|
||||
click_on 'Commencer la démarche'
|
||||
|
||||
expect(page).to have_current_path(siret_dossier_path(dossier))
|
||||
expect_page_to_have_procedure_description(procedure)
|
||||
|
||||
fill_in 'Numéro SIRET', with: '0000'
|
||||
click_on 'Valider'
|
||||
|
|
|
@ -48,11 +48,14 @@ feature 'linked dropdown lists' do
|
|||
|
||||
def log_in(email, password, procedure)
|
||||
visit "/commencer/#{procedure.path}"
|
||||
click_on 'J’ai déjà un compte'
|
||||
|
||||
expect(page).to have_current_path(new_user_session_path)
|
||||
|
||||
fill_in 'user_email', with: email
|
||||
fill_in 'user_password', with: password
|
||||
click_on 'Se connecter'
|
||||
|
||||
expect(page).to have_current_path(identite_dossier_path(user_dossier))
|
||||
end
|
||||
|
||||
|
|
|
@ -41,8 +41,8 @@ feature 'Signing up:' do
|
|||
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'
|
||||
expect(page).to have_current_path new_user_registration_path
|
||||
expect_page_to_have_procedure_description(procedure)
|
||||
|
||||
sign_up_with user_email, user_password
|
||||
|
@ -50,6 +50,7 @@ feature 'Signing up:' do
|
|||
|
||||
click_confirmation_link_for user_email
|
||||
expect(page).to have_content 'Votre compte a été activé'
|
||||
expect(page).to have_current_path identite_dossier_path(procedure.reload.dossiers.last)
|
||||
expect_page_to_have_procedure_description(procedure)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -21,6 +21,7 @@ feature 'Signin in:' do
|
|||
end
|
||||
|
||||
scenario 'an existing user can sign-in and fill the procedure' do
|
||||
click_on 'J’ai déjà un compte'
|
||||
expect(page).to have_current_path new_user_session_path
|
||||
expect_page_to_have_procedure_description(procedure)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue