diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 77d7fb38..29cc5cce 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -27,11 +27,8 @@ def current_user_dev # After signing out from the local application, # redirect to the logout path for the Login app def after_sign_out_path_for(resource_or_scope) - if logout_path.present? - logout_path - else - super(resource_or_scope) - end + Faraday.get(logout_path) if logout_path.present? + super(resource_or_scope) end def logout_path diff --git a/spec/routing/user_routing_spec.rb b/spec/routing/user_routing_spec.rb index b7e5eea4..f04b803d 100644 --- a/spec/routing/user_routing_spec.rb +++ b/spec/routing/user_routing_spec.rb @@ -1,33 +1,42 @@ # frozen_string_literal: true describe 'routes for users' do - describe 'GET /auth/shibboleth' do - subject { get('/auth/shibboleth') } - it do - should route_to({ - controller: 'omniauth_callbacks', - action: 'passthru' - }) + describe 'Logging in' do + describe 'GET /auth/shibboleth' do + subject { get('/auth/shibboleth') } + it do + should route_to({ + controller: 'omniauth_callbacks', + action: 'passthru' + }) + end end - end - describe 'POST /auth/shibboleth' do - subject { post('/auth/shibboleth') } - it do - should route_to({ - controller: 'omniauth_callbacks', - action: 'passthru' - }) + describe 'POST /auth/shibboleth' do + subject { post('/auth/shibboleth') } + it do + should route_to({ + controller: 'omniauth_callbacks', + action: 'passthru' + }) + end + end + + describe 'GET /auth/shibboleth/callback' do + subject { get('/auth/shibboleth/callback') } + it { should route_to({ controller: 'omniauth_callbacks', action: 'shibboleth' }) } end - end - describe 'GET /auth/shibboleth/callback' do - subject { get('/auth/shibboleth/callback') } - it { should route_to({ controller: 'omniauth_callbacks', action: 'shibboleth' }) } + describe 'POST /auth/shibboleth/callback' do + subject { post('/auth/shibboleth/callback') } + it { should route_to({ controller: 'omniauth_callbacks', action: 'shibboleth' }) } + end end - describe 'POST /auth/shibboleth/callback' do - subject { post('/auth/shibboleth/callback') } - it { should route_to({ controller: 'omniauth_callbacks', action: 'shibboleth' }) } + describe 'Logging out' do + describe 'GET /logout' do + subject { get('/logout') } + it { should route_to({ controller: 'devise/sessions', action: 'destroy' }) } + end end end