FC ParticulierClientSpec: simplier spec

This commit is contained in:
simon lehericey 2018-01-11 11:50:04 +01:00 committed by Simon Lehericey
parent 4c2da46dd8
commit 06d9c4356e

View file

@ -2,16 +2,14 @@ require 'spec_helper'
describe FranceConnectParticulierClient do
describe '.initialize' do
it 'create an openid client' do
expect(described_class).to be < OpenIDConnect::Client
end
subject { FranceConnectParticulierClient.new(code) }
context 'when given code in params' do
let(:code) { 'plop' }
subject { described_class.new(code) }
it 'set authorisation code' do
expect_any_instance_of(described_class).to receive(:authorization_code=).with(code)
described_class.new(code)
end
before { allow_any_instance_of(FranceConnectParticulierClient).to receive(:authorization_code=) }
it { is_expected.to have_received(:authorization_code=).with(code) }
end
end
end