PiecesJustificativesService: improve error message when the file cannot be saved
This commit is contained in:
parent
e0828dda13
commit
395c9d5bb1
2 changed files with 3 additions and 3 deletions
|
@ -40,7 +40,7 @@ class PiecesJustificativesService
|
|||
type_de_piece_justificative: tpj,
|
||||
user: user)
|
||||
|
||||
pj.save ? nil : "le fichier #{pj.libelle} n'a pas pu être sauvegardé"
|
||||
pj.save ? nil : "le fichier #{content.original_filename} (#{pj.libelle}) n'a pas pu être sauvegardé"
|
||||
end
|
||||
|
||||
def self.missing_pj_error_messages(dossier)
|
||||
|
|
|
@ -31,11 +31,11 @@ describe PiecesJustificativesService do
|
|||
let(:hash) do
|
||||
{
|
||||
"piece_justificative_#{tpj_not_mandatory.id}" =>
|
||||
double(path: '', original_filename: 'file')
|
||||
double(path: '', original_filename: 'filename')
|
||||
}
|
||||
end
|
||||
|
||||
it { expect(errors).to match(["le fichier not mandatory n'a pas pu être sauvegardé"]) }
|
||||
it { expect(errors).to match(["le fichier filename (not mandatory) n'a pas pu être sauvegardé"]) }
|
||||
end
|
||||
|
||||
context 'when a virus is provided' do
|
||||
|
|
Loading…
Reference in a new issue