Show titre identite link only once watermark is added

This commit is contained in:
Paul Chavard 2020-12-10 12:50:40 +01:00
parent 984818c051
commit 3c6e30a326
6 changed files with 25 additions and 9 deletions

View file

@ -27,6 +27,17 @@ describe 'shared/attachment/_show.html.haml', type: :view do
end
end
context 'when watermark is pending' do
let(:champ) { create(:champ_titre_identite) }
it 'displays the filename, but doesnt allow to download the file' do
pp champ.piece_justificative_file.attachment.watermark_pending?
expect(subject).to have_text(champ.piece_justificative_file.filename.to_s)
expect(subject).not_to have_link(champ.piece_justificative_file.filename.to_s)
expect(subject).to have_text('traitement de la pièce en cours')
end
end
context 'when the file is scanned and safe' do
let(:virus_scan_result) { ActiveStorage::VirusScanner::SAFE }