Merge pull request #9757 from mfo/US/fix-extends-duree-conservation-dossier
correctif(expiration): etends la durée de conservation des dossiers quand la duree de conservation d'une procedure change
This commit is contained in:
commit
dbfbaf4cea
2 changed files with 2 additions and 2 deletions
|
@ -917,7 +917,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?
|
||||
|
|
|
@ -1709,7 +1709,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
|
||||
|
|
Loading…
Reference in a new issue