From 0aba708b3424e590953f91ca789330a59ae98d98 Mon Sep 17 00:00:00 2001 From: Martin Date: Mon, 16 Jan 2023 10:16:23 +0100 Subject: [PATCH] =?UTF-8?q?correctif(spec):=20associe=20le=20dossier=20sui?= =?UTF-8?q?vis=20a=20l'instructeur=20du=20batch=20operation.=20sinon=20c'e?= =?UTF-8?q?st=20un=20autre=20instructeur=20qui=20est=20cr=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spec/factories/batch_operation.rb | 4 ++-- spec/jobs/batch_operation_process_one_job_spec.rb | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/spec/factories/batch_operation.rb b/spec/factories/batch_operation.rb index 639b2b671..e82e396b7 100644 --- a/spec/factories/batch_operation.rb +++ b/spec/factories/batch_operation.rb @@ -56,8 +56,8 @@ FactoryBot.define do after(:build) do |batch_operation, evaluator| procedure = create(:simple_procedure, :published, instructeurs: [evaluator.invalid_instructeur.presence || batch_operation.instructeur], administrateurs: [create(:administrateur)]) batch_operation.dossiers = [ - create(:dossier, :with_individual, :followed, :en_instruction, procedure: procedure), - create(:dossier, :with_individual, :followed, :en_construction, procedure: procedure) + create(:dossier, :with_individual, :en_instruction, procedure: procedure, followers_instructeurs: procedure.instructeurs), + create(:dossier, :with_individual, :en_construction, procedure: procedure, followers_instructeurs: procedure.instructeurs) ] end end diff --git a/spec/jobs/batch_operation_process_one_job_spec.rb b/spec/jobs/batch_operation_process_one_job_spec.rb index 5b762a672..24946cd09 100644 --- a/spec/jobs/batch_operation_process_one_job_spec.rb +++ b/spec/jobs/batch_operation_process_one_job_spec.rb @@ -68,9 +68,9 @@ describe BatchOperationProcessOneJob, type: :job do it 'removes a follower to the dossier' do expect { subject.perform_now } - .to change { dossier_job.reload.follows.first.unfollowed_at } - .from(nil) - .to(anything) + .to change { dossier_job.reload.follows.count } + .from(1) + .to(0) end end