Avoid sending notification emails about archived dossiers

This commit is contained in:
Nicolas Bouilleaud 2019-09-20 10:45:44 +02:00
parent a2131d0fcc
commit f74fde3f80
2 changed files with 2 additions and 2 deletions

View file

@ -176,7 +176,7 @@ class Instructeur < ApplicationRecord
h = {
nb_en_construction: groupe.dossiers.en_construction.count,
nb_notification: notifications_for_procedure(procedure, :all).count
nb_notification: notifications_for_procedure(procedure, :not_archived).count
}
if h[:nb_en_construction] > 0 || h[:nb_notification] > 0

View file

@ -389,7 +389,7 @@ describe Instructeur, type: :model do
context 'when a notification exists' do
before do
allow(instructeur).to receive(:notifications_for_procedure)
.with(procedure_to_assign, :all)
.with(procedure_to_assign, :not_archived)
.and_return([1, 2, 3])
end