generate pdf export inside pieces_justificatives_service

This commit is contained in:
Christophe Robillard 2021-03-29 21:45:46 +02:00
parent c25f3c79d9
commit fba0d78153
7 changed files with 41 additions and 34 deletions

View file

@ -12,6 +12,8 @@ feature 'Inviting an expert:', js: true do
context 'as an Instructeur' do
scenario 'I can invite an expert' do
allow(ClamavService).to receive(:safe_file?).and_return(true)
# assign instructeur to linked dossier
instructeur.assign_to_procedure(linked_dossier.procedure)

View file

@ -165,10 +165,10 @@ feature 'Instructing a dossier:', js: true do
expect(DownloadHelpers.download).to include "dossier-#{dossier.id}.zip"
expect(files.size).to be 3
expect(files[0].filename.include?('piece_justificative_0')).to be_truthy
expect(files[0].uncompressed_size).to be File.size(path)
expect(files[1].filename.include?('horodatage/operation')).to be_truthy
expect(files[2].filename.include?('dossier/export')).to be_truthy
expect(files[0].filename.include?('export')).to be_truthy
expect(files[1].filename.include?('piece_justificative_0')).to be_truthy
expect(files[1].uncompressed_size).to be File.size(path)
expect(files[2].filename.include?('horodatage/operation')).to be_truthy
end
scenario 'A instructeur can download an archive containing several identical attachments' do
@ -180,13 +180,13 @@ feature 'Instructing a dossier:', js: true do
expect(DownloadHelpers.download).to include "dossier-#{dossier.id}.zip"
expect(files.size).to be 4
expect(files[0].filename.include?('piece_justificative_0')).to be_truthy
expect(files[0].filename.include?('export')).to be_truthy
expect(files[1].filename.include?('piece_justificative_0')).to be_truthy
expect(files[0].filename).not_to eq files[1].filename
expect(files[0].uncompressed_size).to be File.size(path)
expect(files[2].filename.include?('piece_justificative_0')).to be_truthy
expect(files[1].filename).not_to eq files[2].filename
expect(files[1].uncompressed_size).to be File.size(path)
expect(files[2].filename.include?('horodatage/operation')).to be_truthy
expect(files[3].filename.include?('dossier/export')).to be_truthy
expect(files[2].uncompressed_size).to be File.size(path)
expect(files[3].filename.include?('horodatage/operation')).to be_truthy
end
before { DownloadHelpers.clear_downloads }