Merge pull request #3644 from betagouv/fix-3641

[Fix #3641] Do not change PJ value in API if PJ is safe
This commit is contained in:
Mathieu Magnin 2019-03-20 11:44:48 +01:00 committed by GitHub
commit a1156c8c41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -49,7 +49,7 @@ class Champs::PieceJustificativeChamp < Champ
end
def for_api
if piece_justificative_file.attached? && virus_scan&.safe?
if piece_justificative_file.attached? && (virus_scan&.safe? || virus_scan&.pending?)
Rails.application.routes.url_helpers.url_for(piece_justificative_file)
end
end

View file

@ -13,7 +13,7 @@ describe Champs::PieceJustificativeChamp do
context 'when file is not scanned' do
let(:status) { 'pending' }
it { is_expected.to be_nil }
it { is_expected.to include("/rails/active_storage/blobs/") }
end
context 'when file is infected' do