dossier: make messagerie available on archived procedures (#4091)

Instructeur : ré-active la messagerie sur les démarches archivées
This commit is contained in:
Pierre de La Morinerie 2019-07-11 15:45:38 +02:00 committed by GitHub
commit 420f7362fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 13 deletions

View file

@ -225,7 +225,7 @@ class Dossier < ApplicationRecord
end
def messagerie_available?
!brouillon? && !archived && !procedure.archivee?
!brouillon? && !archived
end
def retention_end_date

View file

@ -747,23 +747,17 @@ describe Dossier do
it { is_expected.to be false }
end
context "dossier is submitted" do
before { dossier.state = Dossier.states.fetch(:en_instruction) }
it { is_expected.to be true }
end
context "dossier is archived" do
before { dossier.archived = true }
it { is_expected.to be false }
end
context "procedure is archived" do
before { procedure.archived_at = Date.today }
it { is_expected.to be false }
end
context "procedure is not archived, dossier is not archived" do
before { dossier.state = Dossier.states.fetch(:en_instruction) }
it { is_expected.to be true }
end
end
context "retention date" do