2019-07-01 15:55:37 +02:00
|
|
|
describe ActiveStorage::DownloadableFile do
|
2021-06-24 21:01:59 +02:00
|
|
|
let(:dossier) { create(:dossier, :en_construction) }
|
2019-07-25 15:57:00 +02:00
|
|
|
|
2022-04-05 14:20:59 +02:00
|
|
|
subject(:list) { ActiveStorage::DownloadableFile.create_list_from_dossiers(Dossier.where(id: dossier.id)) }
|
2019-07-01 15:55:37 +02:00
|
|
|
|
2022-04-05 14:20:59 +02:00
|
|
|
describe 'create_list_from_dossiers' do
|
2019-07-01 15:55:37 +02:00
|
|
|
context 'when no piece_justificative is present' do
|
2021-03-08 11:35:20 +01:00
|
|
|
it { expect(list.length).to eq 1 }
|
2021-06-24 21:01:59 +02:00
|
|
|
it { expect(list.first[0].name).to eq "pdf_export_for_instructeur" }
|
2019-07-01 15:55:37 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|