download a dossier as zip with all attachments
This commit is contained in:
parent
5a70ae7a8f
commit
25f81f1d3c
14 changed files with 194 additions and 2 deletions
26
spec/lib/active_storage/downloadable_file_spec.rb
Normal file
26
spec/lib/active_storage/downloadable_file_spec.rb
Normal file
|
@ -0,0 +1,26 @@
|
|||
describe ActiveStorage::DownloadableFile do
|
||||
let(:tpjs) { [tpj_not_mandatory] }
|
||||
let!(:tpj_not_mandatory) do
|
||||
TypeDePieceJustificative.create(libelle: 'not mandatory', mandatory: false)
|
||||
end
|
||||
let(:procedure) { Procedure.create(types_de_piece_justificative: tpjs) }
|
||||
let(:dossier) { Dossier.create(procedure: procedure) }
|
||||
let(:procedure) { Procedure.create(types_de_piece_justificative: tpjs) }
|
||||
let(:dossier) { Dossier.create(procedure: procedure) }
|
||||
let(:list) { ActiveStorage::DownloadableFile.create_list_from_dossier(dossier) }
|
||||
|
||||
describe 'create_list_from_dossier' do
|
||||
context 'when no piece_justificative is present' do
|
||||
it { expect(list).to match([]) }
|
||||
end
|
||||
|
||||
context 'when there is a piece_justificative' do
|
||||
let (:pj) { create(:champ, :piece_justificative, :with_piece_justificative_file) }
|
||||
before do
|
||||
dossier.champs = [pj]
|
||||
end
|
||||
|
||||
it { expect(list.length).to be 1 }
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue