Delete FC Enterprise tests
This commit is contained in:
parent
8c99559dae
commit
2b6a46f335
2 changed files with 2 additions and 32 deletions
|
@ -1,7 +1,7 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe Users::SessionsController, type: :controller do
|
||||
let(:loged_in_with_france_connect) { 'entreprise' }
|
||||
let(:loged_in_with_france_connect) { 'particulier' }
|
||||
let(:user) { create(:user, loged_in_with_france_connect: loged_in_with_france_connect) }
|
||||
|
||||
before do
|
||||
|
@ -38,13 +38,8 @@ describe Users::SessionsController, type: :controller do
|
|||
expect(user.loged_in_with_france_connect?).to be_falsey
|
||||
end
|
||||
|
||||
context 'when user is connect with france connect entreprise' do
|
||||
it 'redirect to france connect logout page' do
|
||||
expect(response).to redirect_to(FRANCE_CONNECT.entreprise_logout_endpoint)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when user is connect with france connect entreprise' do
|
||||
context 'when user is connect with france connect particulier' do
|
||||
let(:loged_in_with_france_connect) { 'particulier' }
|
||||
|
||||
it 'redirect to france connect logout page' do
|
||||
|
|
|
@ -1,31 +1,6 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe FranceConnectService do
|
||||
describe '.retrieve_user_informations_entreprise' do
|
||||
let(:code) { 'plop' }
|
||||
let(:access_token) { 'my access_token' }
|
||||
let(:email) { 'patator@cake.com' }
|
||||
let(:siret) { '41123069100049' }
|
||||
let(:user_info_hash) { {'email' => email, 'siret' => siret} }
|
||||
let(:user_info) { instance_double('OpenIDConnect::ResponseObject::UserInfo', raw_attributes: user_info_hash, email: email) }
|
||||
|
||||
subject { described_class.retrieve_user_informations_entreprise code }
|
||||
|
||||
before do
|
||||
allow_any_instance_of(FranceConnectEntrepriseClient).to receive(:access_token!).and_return(access_token)
|
||||
allow(access_token).to receive(:userinfo!).and_return(user_info)
|
||||
end
|
||||
it 'set code for FranceConnectEntrepriseClient' do
|
||||
expect_any_instance_of(FranceConnectEntrepriseClient).to receive(:authorization_code=).with(code)
|
||||
described_class.retrieve_user_informations_entreprise code
|
||||
end
|
||||
|
||||
it 'returns user informations in a object' do
|
||||
expect(subject.email).to eq(email)
|
||||
expect(subject.siret).to eq(siret)
|
||||
end
|
||||
end
|
||||
|
||||
describe '.retrieve_user_informations_particulier' do
|
||||
let(:code) { 'plop' }
|
||||
let(:access_token) { 'my access_token' }
|
||||
|
|
Loading…
Reference in a new issue