fix spec with not expired token

and use of `ApiEntrepriseToken#roles`
This commit is contained in:
Christophe Robillard 2020-05-05 16:58:37 +02:00
parent dbf04dd0d8
commit dba77ec0b8
11 changed files with 19 additions and 5 deletions

View file

@ -78,7 +78,8 @@ feature 'Creating a new dossier:' do
.to_return(status: 404, body: '')
stub_request(:get, /https:\/\/entreprise.api.gouv.fr\/v2\/effectifs_annuels_acoss_covid\/#{siren}?.*token=/)
.to_return(status: 404, body: '')
allow_any_instance_of(Procedure).to receive(:api_entreprise_roles).and_return([])
allow_any_instance_of(ApiEntrepriseToken).to receive(:roles).and_return([])
allow_any_instance_of(ApiEntrepriseToken).to receive(:expired?).and_return(false)
end
before { Timecop.freeze(Time.zone.local(2020, 3, 14)) }
after { Timecop.return }