From 7640911ab9dcd93df1c6758b11c78e97ad37d07c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chai=CC=88b=20Martinez?= Date: Fri, 23 Aug 2019 12:15:54 +0200 Subject: [PATCH 1/3] Remove sign up form sign in Add link to sign up help MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Chaïb Martinez --- app/views/users/sessions/new.html.haml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/views/users/sessions/new.html.haml b/app/views/users/sessions/new.html.haml index 9f7a9962f..9dc1d7a36 100644 --- a/app/views/users/sessions/new.html.haml +++ b/app/views/users/sessions/new.html.haml @@ -1,12 +1,6 @@ = content_for(:page_id, 'auth') .auth-form.sign-in-form - %p.register - %span - Nouveau sur demarches‑simplifiees.fr ? - = link_to "Créer un compte", new_user_registration_path, class: "button primary auth-signup-button" - - %hr = form_for User.new, url: user_session_path, html: { class: "form" } do |f| %h1 Connectez-vous @@ -28,3 +22,10 @@ = f.submit "Se connecter", class: "button large primary expand" = render partial: 'shared/france_connect_login', locals: { url: france_connect_particulier_path } + + %hr + %p.center + %span Vous êtes nouveau sur demarches‑simplifiees.fr ? + %br + %br + = link_to "Trouvez votre démarche", "https://faq.demarches-simplifiees.fr/article/59-comment-trouver-ma-demarche", class: "button expend secondary" From 5f20d657d0deff3d2cbffc15615a9600877491e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chai=CC=88b=20Martinez?= Date: Fri, 23 Aug 2019 12:18:28 +0200 Subject: [PATCH 2/3] Add target blank [fix #3536] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Chaïb Martinez --- app/views/users/sessions/new.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/sessions/new.html.haml b/app/views/users/sessions/new.html.haml index 9dc1d7a36..e92e681e2 100644 --- a/app/views/users/sessions/new.html.haml +++ b/app/views/users/sessions/new.html.haml @@ -28,4 +28,4 @@ %span Vous êtes nouveau sur demarches‑simplifiees.fr ? %br %br - = link_to "Trouvez votre démarche", "https://faq.demarches-simplifiees.fr/article/59-comment-trouver-ma-demarche", class: "button expend secondary" + = link_to "Trouvez votre démarche", "https://faq.demarches-simplifiees.fr/article/59-comment-trouver-ma-demarche", target: "_blank", class: "button expend secondary" From 8ad79d3235569d3a74d66b604c691ac6f93163a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chai=CC=88b=20Martinez?= Date: Fri, 23 Aug 2019 15:32:33 +0200 Subject: [PATCH 3/3] New signup test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Chaïb Martinez --- spec/features/users/sign_up_spec.rb | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/spec/features/users/sign_up_spec.rb b/spec/features/users/sign_up_spec.rb index 1436433a4..72da33bcd 100644 --- a/spec/features/users/sign_up_spec.rb +++ b/spec/features/users/sign_up_spec.rb @@ -3,24 +3,23 @@ require 'spec_helper' feature 'Signing up:' do let(:user_email) { generate :user_email } let(:user_password) { 'démarches-simplifiées-pwd' } + let(:procedure) { create :simple_procedure, :with_service } scenario 'a new user can sign-up' do - visit root_path - click_on 'Connexion' - click_on 'Créer un compte' + visit commencer_path(path: procedure.path) + click_on 'Créer un compte demarches-simplifiees.fr' sign_up_with user_email, user_password expect(page).to have_content "nous avons besoin de vérifier votre adresse #{user_email}" click_confirmation_link_for user_email 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 - 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' + 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' expect(page).to have_current_path new_user_registration_path sign_up_with user_email, '1234567' @@ -61,9 +60,8 @@ feature 'Signing up:' do context 'when a user is not confirmed yet' do before do - visit root_path - click_on 'Connexion' - click_on 'Créer un compte' + visit commencer_path(path: procedure.path) + click_on 'Créer un compte demarches-simplifiees.fr' sign_up_with user_email, user_password end