test login FranceConnectController

This commit is contained in:
Xavier J 2015-10-06 16:02:30 +02:00
parent bde99fff1b
commit abe5d94ac5
3 changed files with 14 additions and 2 deletions

View file

@ -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)

View file

@ -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'

View 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