[Fix #319] Include archived dossiers in the export
This commit is contained in:
parent
5253f07b69
commit
4655707eb5
2 changed files with 3 additions and 1 deletions
|
@ -200,7 +200,7 @@ class Dossier < ActiveRecord::Base
|
|||
scope :archived, -> { where(archived: true) }
|
||||
scope :not_archived, -> { where(archived: false) }
|
||||
|
||||
scope :downloadable, -> { all_state }
|
||||
scope :downloadable, -> { not_brouillon.order_by_updated_at("ASC") }
|
||||
|
||||
def cerfa_available?
|
||||
procedure.cerfa_flag? && cerfa.size != 0
|
||||
|
|
|
@ -911,11 +911,13 @@ describe Dossier do
|
|||
let!(:dossier) { create(:dossier, :with_entreprise, procedure: procedure, state: :draft) }
|
||||
let!(:dossier2) { create(:dossier, :with_entreprise, procedure: procedure, state: :initiated) }
|
||||
let!(:dossier3) { create(:dossier, :with_entreprise, procedure: procedure, state: :received) }
|
||||
let!(:dossier4) { create(:dossier, :with_entreprise, procedure: procedure, state: :received, archived: true) }
|
||||
|
||||
subject { procedure.dossiers.downloadable }
|
||||
|
||||
it { is_expected.not_to include(dossier)}
|
||||
it { is_expected.to include(dossier2)}
|
||||
it { is_expected.to include(dossier3)}
|
||||
it { is_expected.to include(dossier4)}
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue