fix(france connect): stub application name in tests

This commit is contained in:
François Vantomme 2021-12-08 19:17:46 +01:00
parent 299a98b3cb
commit 27ccf6bbdd
No known key found for this signature in database
GPG key ID: 75A448E06F6B75F8

View file

@ -149,6 +149,7 @@ describe FranceConnect::ParticulierController, type: :controller do
RSpec.shared_examples "a method that needs a valid merge token" do
context 'when the merge token is invalid' do
before do
stub_const("APPLICATION_NAME", "demarches-simplifiees.fr")
merge_token
fci.update(merge_token_created_at: 2.years.ago)
end
@ -181,6 +182,10 @@ describe FranceConnect::ParticulierController, type: :controller do
context 'when the merge token does not exist' do
let(:merge_token) { 'i do not exist' }
before do
stub_const("APPLICATION_NAME", "demarches-simplifiees.fr")
end
it do
expect(subject).to redirect_to root_path
expect(flash.alert).to eq("Le délai pour fusionner les comptes FranceConnect et demarches-simplifiees.fr est expirée. Veuillez recommencer la procédure pour vous fusionner les comptes.")