Fix Sign out
This commit is contained in:
parent
9fc63d923f
commit
149b0b5797
2 changed files with 17 additions and 8 deletions
|
@ -42,14 +42,6 @@ class Users::SessionsController < Sessions::SessionsController
|
|||
|
||||
# DELETE /resource/sign_out
|
||||
def destroy
|
||||
if instructeur_signed_in?
|
||||
sign_out :instructeur
|
||||
end
|
||||
|
||||
if administrateur_signed_in?
|
||||
sign_out :administrateur
|
||||
end
|
||||
|
||||
if user_signed_in?
|
||||
connected_with_france_connect = current_user.loged_in_with_france_connect
|
||||
current_user.update(loged_in_with_france_connect: '')
|
||||
|
|
17
spec/features/users/sign_out_spec.rb
Normal file
17
spec/features/users/sign_out_spec.rb
Normal file
|
@ -0,0 +1,17 @@
|
|||
require 'spec_helper'
|
||||
|
||||
feature 'Sign out' do
|
||||
context 'when a user is logged in' do
|
||||
let(:user) { create(:administrateur).user }
|
||||
|
||||
before { login_as user, scope: :user }
|
||||
|
||||
scenario 'he can sign out' do
|
||||
visit dossiers_path
|
||||
|
||||
click_on 'Se déconnecter'
|
||||
|
||||
expect(page).to have_current_path(root_path)
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue