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