bug(compteurs.avis.a.donner): ETQ expert, je ne souhaite pas avoir a donner un avis sur un dossier termine

This commit is contained in:
Martin 2023-05-22 10:49:25 +02:00 committed by mfo
parent 1417d0e873
commit d2e30911f7
3 changed files with 17 additions and 4 deletions

View file

@ -17,6 +17,16 @@ describe 'experts/avis/index', type: :view do
expect(subject).to have_text("avis à donner")
end
context 'dossier is termine' do
before do
avis.dossier.update!(state: "accepte")
end
it 'doesnt count avis a donner when dossier is termine' do
expect(subject).to have_selector("##{dom_id(procedure)} .avis-a-donner .stats-number", text: 0)
end
end
context 'when the dossier is deleted by instructeur' do
before do
avis.dossier.update!(state: "accepte", hidden_by_administration_at: Time.zone.now.beginning_of_day.utc)