done spec france connect controller
This commit is contained in:
parent
c57cb5b75d
commit
a4661c932f
2 changed files with 4 additions and 3 deletions
|
@ -27,6 +27,7 @@ class FranceConnectController < ApplicationController
|
|||
end
|
||||
rescue Rack::OAuth2::Client::Error => e
|
||||
Rails.logger.error e.message
|
||||
flash.alert = 'Erreur lors de la connexion à France Connect.'
|
||||
redirect_to(new_user_session_path)
|
||||
end
|
||||
end
|
|
@ -32,15 +32,15 @@ describe FranceConnectController, type: :controller do
|
|||
context 'wen code is not correct' do
|
||||
before do
|
||||
allow(FranceConnectService).to receive(:retrieve_user_informations) { raise Rack::OAuth2::Client::Error.new(500, error: 'Unknown') }
|
||||
get :callback, code: code
|
||||
end
|
||||
|
||||
it 'redirect to login page' do
|
||||
get :callback, code: code
|
||||
expect(response).to redirect_to(new_user_session_path)
|
||||
end
|
||||
|
||||
it 'flash message error connexion with France Connect' do
|
||||
|
||||
it 'display error message' do
|
||||
expect(flash[:alert]).to be_present
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue