2015-10-06 11:32:57 +02:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2015-12-18 12:01:26 +01:00
|
|
|
describe FranceConnectEntrepriseClient do
|
2015-10-06 11:32:57 +02:00
|
|
|
describe '.initialize' do
|
|
|
|
it 'create an openid client' do
|
|
|
|
expect(described_class).to be < OpenIDConnect::Client
|
|
|
|
end
|
|
|
|
context 'when given code in params' do
|
|
|
|
let(:code) { 'plop' }
|
|
|
|
subject { described_class.new(code: code) }
|
|
|
|
it 'set authorisation code' do
|
2015-10-06 11:47:42 +02:00
|
|
|
expect_any_instance_of(described_class).to receive(:authorization_code=).with(code)
|
2015-10-06 11:32:57 +02:00
|
|
|
described_class.new(code: code)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|