From 0e8d2358007a225873d1359af3bc7cfc11dd8071 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chai=CC=88b=20Martinez?= Date: Wed, 21 Nov 2018 15:16:35 +0100 Subject: [PATCH] Add some params to track forms submissions --- app/controllers/demandes_controller.rb | 2 +- app/controllers/support_controller.rb | 2 +- spec/controllers/support_controller_spec.rb | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/demandes_controller.rb b/app/controllers/demandes_controller.rb index ead68d3fc..571233896 100644 --- a/app/controllers/demandes_controller.rb +++ b/app/controllers/demandes_controller.rb @@ -18,7 +18,7 @@ class DemandesController < ApplicationController demande_params[:deadline] ) flash.notice = 'Votre demande a bien été enregistrée, nous vous contacterons rapidement.' - redirect_to administration_path + redirect_to administration_path(formulaire_demande_compte_admin_submitted: true) end private diff --git a/app/controllers/support_controller.rb b/app/controllers/support_controller.rb index 0b073a96f..310a62c2e 100644 --- a/app/controllers/support_controller.rb +++ b/app/controllers/support_controller.rb @@ -13,7 +13,7 @@ class SupportController < ApplicationController elsif create_conversation flash.notice = "Votre message a été envoyé." - redirect_to root_path + redirect_to root_path(formulaire_contact_general_submitted: true) else setup_context flash.now.alert = "Une erreur est survenue. Vous pouvez nous contactez à #{helpers.mail_to(CONTACT_EMAIL)}." diff --git a/spec/controllers/support_controller_spec.rb b/spec/controllers/support_controller_spec.rb index 438abdb9d..abf9a8187 100644 --- a/spec/controllers/support_controller_spec.rb +++ b/spec/controllers/support_controller_spec.rb @@ -61,7 +61,7 @@ describe SupportController, type: :controller do } expect(flash[:notice]).to match('Votre message a été envoyé.') - expect(response).to redirect_to root_path + expect(response).to redirect_to root_path(formulaire_contact_general_submitted: true) end context "with dossier" do @@ -80,7 +80,7 @@ describe SupportController, type: :controller do } expect(flash[:notice]).to match('Votre message a été envoyé.') - expect(response).to redirect_to root_path + expect(response).to redirect_to root_path(formulaire_contact_general_submitted: true) end context "en_construction" do