FC ParticulierControllerSpec: without an associate user, better test
This commit is contained in:
parent
b2f59e2b14
commit
570f779bb2
1 changed files with 6 additions and 1 deletions
|
@ -38,7 +38,7 @@ describe FranceConnect::ParticulierController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when france_connect_particulier_id exist in database' do
|
context 'when france_connect_particulier_id exist in database' do
|
||||||
let!(:france_connect_information) { create(:france_connect_information, france_connect_particulier_id: france_connect_particulier_id, given_name: given_name, family_name: family_name, birthdate: birthdate, gender: gender, birthplace: birthplace) }
|
let!(:france_connect_information) { create(:france_connect_information, user_info) }
|
||||||
|
|
||||||
it { expect { subject }.not_to change { FranceConnectInformation.count } }
|
it { expect { subject }.not_to change { FranceConnectInformation.count } }
|
||||||
|
|
||||||
|
@ -60,6 +60,11 @@ describe FranceConnect::ParticulierController, type: :controller do
|
||||||
|
|
||||||
context 'when france_connect_particulier_id does not have an associate user' do
|
context 'when france_connect_particulier_id does not have an associate user' do
|
||||||
it { is_expected.to redirect_to(root_path) }
|
it { is_expected.to redirect_to(root_path) }
|
||||||
|
|
||||||
|
it do
|
||||||
|
subject
|
||||||
|
expect(User.find_by(email: email)).not_to be_nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue