demarches-normaliennes/spec/lib/active_storage/downloadable_file_spec.rb
2022-04-07 12:06:13 +02:00

12 lines
443 B
Ruby

describe ActiveStorage::DownloadableFile do
let(:dossier) { create(:dossier, :en_construction) }
subject(:list) { ActiveStorage::DownloadableFile.create_list_from_dossiers(Dossier.where(id: dossier.id)) }
describe 'create_list_from_dossiers' do
context 'when no piece_justificative is present' do
it { expect(list.length).to eq 1 }
it { expect(list.first[0].name).to eq "pdf_export_for_instructeur" }
end
end
end