From 99ce5195bc4a889c46ffaaa4333d471798f4e1cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Vantomme?= Date: Fri, 7 May 2021 10:41:45 +0200 Subject: [PATCH] Fix (API Entreprise): test fails randomly Don't assume array order, just check that all values are present --- spec/jobs/api_entreprise/exercices_job_spec.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/jobs/api_entreprise/exercices_job_spec.rb b/spec/jobs/api_entreprise/exercices_job_spec.rb index 1addbce62..db1359563 100644 --- a/spec/jobs/api_entreprise/exercices_job_spec.rb +++ b/spec/jobs/api_entreprise/exercices_job_spec.rb @@ -15,6 +15,7 @@ RSpec.describe APIEntreprise::ExercicesJob, type: :job do it 'updates etablissement' do subject - expect(Etablissement.find(etablissement.id).exercices[0].ca).to eq('21009417') + ca_list = Etablissement.find(etablissement.id).exercices.map(&:ca) + expect(ca_list).to contain_exactly('21009417', '18968298', '17768838') end end