From 57d7b385ec151160dfe3e249cead9c2efda26927 Mon Sep 17 00:00:00 2001 From: Martin Date: Tue, 28 Nov 2023 16:59:41 +0100 Subject: [PATCH] =?UTF-8?q?correctif(expiration):=20etends=20la=20dur?= =?UTF-8?q?=C3=A9e=20de=20conservation=20des=20dossiers=20quand=20la=20dur?= =?UTF-8?q?ee=20de=20conservation=20d'une=20procedure=20change?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/procedure.rb | 2 +- spec/models/procedure_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/procedure.rb b/app/models/procedure.rb index 47ab405a8..b0cea15af 100644 --- a/app/models/procedure.rb +++ b/app/models/procedure.rb @@ -911,7 +911,7 @@ class Procedure < ApplicationRecord end def extend_conservation_for_dossiers - return if previous_changes.include?(:duree_conservation_dossiers_dans_ds) + return if !previous_changes.include?(:duree_conservation_dossiers_dans_ds) before, after = duree_conservation_dossiers_dans_ds_previous_change return if [before, after].any?(&:nil?) return if (after - before).negative? diff --git a/spec/models/procedure_spec.rb b/spec/models/procedure_spec.rb index 516d54eda..fbe39bd11 100644 --- a/spec/models/procedure_spec.rb +++ b/spec/models/procedure_spec.rb @@ -1687,7 +1687,7 @@ describe Procedure do context 'when duree_conservation_dossiers_dans_ds increases' do it 'calls extend_conservation_for_dossiers' do - expect(ResetExpiringDossiersJob).not_to receive(:perform_later) + expect(ResetExpiringDossiersJob).to receive(:perform_later) procedure.update(duree_conservation_dossiers_dans_ds: duree_conservation_dossiers_dans_ds + 1) end end