ajout de test capybara
This commit is contained in:
parent
80b68afab5
commit
849008231c
1 changed files with 26 additions and 0 deletions
|
@ -17,6 +17,32 @@ feature 'Signing up:' do
|
|||
expect(page).to have_current_path commencer_path(path: procedure.path)
|
||||
end
|
||||
|
||||
context 'a new user can sign-up and be suggested a valid email when he makes a typo' do
|
||||
let(:procedure) { create :simple_procedure, :with_service }
|
||||
|
||||
before do
|
||||
visit commencer_path(path: procedure.path)
|
||||
click_on 'Créer un compte demarches-simplifiees.fr'
|
||||
expect(page).to have_selector('.suspect-email', visible: false)
|
||||
fill_in :user_email, with: 'bidou@yahoo.rf'
|
||||
fill_in :user_password, with: '12345'
|
||||
end
|
||||
|
||||
scenario 'it can accept the suggestion' do
|
||||
expect(page).to have_selector('.suspect-email', visible: true)
|
||||
click_on 'Oui'
|
||||
# expect(page).to have_field("Email", :with => 'bidou@yahoo.fr')
|
||||
expect(page).to have_selector('.suspect-email', visible: false)
|
||||
end
|
||||
|
||||
scenario 'it can discard the suggestion' do
|
||||
expect(page).to have_selector('.suspect-email', visible: true)
|
||||
click_on 'Non'
|
||||
expect(page).to have_field("Email", :with => 'bidou@yahoo.rf')
|
||||
expect(page).to have_selector('.suspect-email', visible: false)
|
||||
end
|
||||
end
|
||||
|
||||
scenario 'a new user can’t sign-up with too short password when visiting a procedure' do
|
||||
visit commencer_path(path: procedure.path)
|
||||
click_on 'Créer un compte demarches-simplifiees.fr'
|
||||
|
|
Loading…
Reference in a new issue