Merge pull request #4909 from betagouv/dev

2020-03-18-02
This commit is contained in:
krichtof 2020-03-18 15:03:28 +01:00 committed by GitHub
commit d227e89eb7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 14 deletions

View file

@ -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)

View file

@ -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

View file

@ -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 "Jai 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