From 952bae32fe6ba5d2729ebc7205a525d1f56c1d71 Mon Sep 17 00:00:00 2001 From: Christophe Robillard Date: Wed, 18 Mar 2020 14:45:39 +0100 Subject: [PATCH] Revert "go to procedure after cliking link" This reverts commit 795eabb1ea92759a4a33c4dcc0ce3f0d9ec2b1b5. --- app/controllers/application_controller.rb | 2 +- spec/controllers/application_controller_spec.rb | 1 - spec/features/users/dossier_creation_spec.rb | 12 ------------ 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 5ec259b6f..b78fe1b90 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -198,7 +198,7 @@ class ApplicationController < ActionController::Base # return at this location # after the device is trusted - store_location_for(:user, request.fullpath) if get_stored_location_for(:user).blank? + store_location_for(:user, request.fullpath) send_login_token_or_bufferize(current_instructeur) redirect_to link_sent_path(email: current_instructeur.email) diff --git a/spec/controllers/application_controller_spec.rb b/spec/controllers/application_controller_spec.rb index 8289c3482..990c55961 100644 --- a/spec/controllers/application_controller_spec.rb +++ b/spec/controllers/application_controller_spec.rb @@ -164,7 +164,6 @@ describe ApplicationController, type: :controller do allow(@controller).to receive(:instructeur_signed_in?).and_return(instructeur_signed_in) allow(@controller).to receive(:sensitive_path).and_return(sensitive_path) allow(@controller).to receive(:send_login_token_or_bufferize) - allow(@controller).to receive(:get_stored_location_for).and_return(nil) allow(@controller).to receive(:store_location_for) allow(IPService).to receive(:ip_trusted?).and_return(ip_trusted) end diff --git a/spec/features/users/dossier_creation_spec.rb b/spec/features/users/dossier_creation_spec.rb index e54228974..662d02918 100644 --- a/spec/features/users/dossier_creation_spec.rb +++ b/spec/features/users/dossier_creation_spec.rb @@ -110,16 +110,4 @@ feature 'Creating a new dossier:' do end end end - - context 'when the user is not signed in' do - let(:instructeur) { create(:instructeur) } - let(:procedure) { create(:procedure, :published) } - scenario 'the user is an instructeur with untrusted device' do - visit commencer_path(path: procedure.path) - click_on "J’ai déjà un compte" - sign_in_with(instructeur.email, instructeur.user.password, true) - - expect(page).to have_current_path(commencer_path(path: procedure.path)) - end - end end