test login FranceConnectController
This commit is contained in:
parent
bde99fff1b
commit
abe5d94ac5
3 changed files with 14 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
||||||
class FranceConnectController < ApplicationController
|
class FranceConnectController < ApplicationController
|
||||||
def index
|
def login
|
||||||
client = FranceConnectClient.new
|
client = FranceConnectClient.new
|
||||||
|
|
||||||
session[:state] = SecureRandom.hex(16)
|
session[:state] = SecureRandom.hex(16)
|
||||||
|
|
|
@ -13,7 +13,7 @@ Rails.application.routes.draw do
|
||||||
# root 'users/france_connect_callbacks#login'
|
# root 'users/france_connect_callbacks#login'
|
||||||
|
|
||||||
|
|
||||||
get 'france_connect' => 'france_connect#index'
|
get 'france_connect' => 'france_connect#login'
|
||||||
get 'france_connect/callback' => 'france_connect#callback'
|
get 'france_connect/callback' => 'france_connect#callback'
|
||||||
|
|
||||||
|
|
||||||
|
|
12
spec/controllers/france_connect_controller_spec.rb
Normal file
12
spec/controllers/france_connect_controller_spec.rb
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe FranceConnectController, type: :controller do
|
||||||
|
|
||||||
|
describe '.login' do
|
||||||
|
it 'redirect to france connect serveur' do
|
||||||
|
get :login
|
||||||
|
expect(response.status).to eq(302)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
Loading…
Reference in a new issue