From f87e316a5dd8089945b3b60efadf754c7583c516 Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Fri, 16 Aug 2019 11:45:40 +0200 Subject: [PATCH] Spec: remove outdated trusted_device logic This is tested on the application controller --- .../users/sessions_controller_spec.rb | 23 +------------------ 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/spec/controllers/users/sessions_controller_spec.rb b/spec/controllers/users/sessions_controller_spec.rb index 0a42fc26a..b6ec9ecc5 100644 --- a/spec/controllers/users/sessions_controller_spec.rb +++ b/spec/controllers/users/sessions_controller_spec.rb @@ -13,11 +13,9 @@ describe Users::SessionsController, type: :controller do let!(:administrateur) { create(:administrateur, email: email, password: password) } let(:instructeur) { administrateur.instructeur } let(:user) { instructeur.user } - let(:trusted_device) { true } let(:send_password) { password } before do - allow(controller).to receive(:trusted_device?).and_return(trusted_device) allow(InstructeurMailer).to receive(:send_login_token).and_return(double(deliver_later: true)) end @@ -26,26 +24,7 @@ describe Users::SessionsController, type: :controller do user.reload end - context 'when the device is not trusted' do - before do - Flipflop::FeatureSet.current.test!.switch!(:bypass_email_login_token, false) - end - let(:trusted_device) { false } - - it 'redirects to the send_linked_path' do - subject - - expect(controller).to redirect_to(link_sent_path(email: user.email)) - - expect(controller.current_user).to eq(user) - expect(controller.current_instructeur).to eq(instructeur) - # WTF? - # expect(controller.current_administrateur).to eq(administrateur) - expect(user.loged_in_with_france_connect).to eq(nil) - end - end - - context 'when the device is trusted' do + context 'when the credentials are right' do it 'signs in as user, instructeur and adminstrateur' do subject