From f5fa0499ca8a47dd917db8eac38e20d40951de45 Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Wed, 9 Jan 2019 10:58:04 +0100 Subject: [PATCH] SessionControllerSpec: remove duplicated tests --- .../users/sessions_controller_spec.rb | 37 ------------------- 1 file changed, 37 deletions(-) diff --git a/spec/controllers/users/sessions_controller_spec.rb b/spec/controllers/users/sessions_controller_spec.rb index 3178b11ec..8e9787a16 100644 --- a/spec/controllers/users/sessions_controller_spec.rb +++ b/spec/controllers/users/sessions_controller_spec.rb @@ -60,43 +60,6 @@ describe Users::SessionsController, type: :controller do end end - context 'signs administrateur in' do - # an admin has always an gestionnaire role - before { gestionnaire } - - it 'signs administrateur in' do - post :create, params: { user: { email: administrateur.email, password: administrateur.password } } - - expect(subject).to redirect_to link_sent_path(email: gestionnaire.email) - - expect(subject.current_user).to eq(user) - expect(subject.current_gestionnaire).to be(nil) - expect(subject.current_administrateur).to eq(nil) - end - end - - context { - before do - user - gestionnaire - end - - it 'signs user + gestionnaire + administrateur in' do - post :create, params: { user: { email: administrateur.email, password: administrateur.password } } - - expect(subject).to redirect_to link_sent_path(email: gestionnaire.email) - - # TODO: fix me - # Strange behaviour: sign_out(:user) does not work in spec - # but seems to work in live - # expect(controller.current_user).to be(nil) - - expect(subject.current_gestionnaire).to be(nil) - expect(subject.current_administrateur).to be(nil) - expect(user.reload.loged_in_with_france_connect).to be(nil) - end - } - it 'fails to sign in with bad credentials' do post :create, params: { user: { email: user.email, password: 'wrong_password' } } expect(@response.unauthorized?).to be(true)