Check if France Connect User is a mandataire social of the enterprise

This commit is contained in:
Xavier J 2016-01-06 14:17:08 +01:00
parent 3f048d0709
commit 332eab3771
4 changed files with 43 additions and 2 deletions

View file

@ -86,6 +86,7 @@ describe Users::DossiersController, type: :controller do
describe 'dossier attributs' do
let(:user) { create(:user) }
context 'with valid siret ' do
before do
sign_in user
@ -140,6 +141,30 @@ describe Users::DossiersController, type: :controller do
expect(Dossier.last.state).to eq('draft')
end
describe 'Mandataires Sociaux' do
let(:user) { create(:user, given_name: given_name, family_name: family_name, birthdate: birthdate, france_connect_particulier_id: '1234567') }
before do
subject
end
context 'when user is present in mandataires sociaux' do
let(:given_name) { 'GERARD' }
let(:family_name) { 'DEGONSE' }
let(:birthdate) { '1947-07-03' }
it { expect(Dossier.last.mandataire_social).to be_truthy }
end
context 'when user is not present in mandataires sociaux' do
let(:given_name) { 'plop' }
let(:family_name) { 'plip' }
let(:birthdate) { '1965-01-27' }
it { expect(Dossier.last.mandataire_social).to be_falsey }
end
end
describe 'get rna informations' do
context 'when siren have not rna informations' do
let(:rna_status) { 404 }