refactor(suffix): be consistent with index suffix
This commit is contained in:
parent
b656867836
commit
585810553f
2 changed files with 3 additions and 6 deletions
|
@ -148,11 +148,8 @@ class ExportTemplate < ApplicationRecord
|
|||
end
|
||||
|
||||
def suffix(attachment, index, row_index)
|
||||
suffix = ""
|
||||
if index >= 1 && !row_index.nil?
|
||||
suffix += "-#{index + 1}"
|
||||
suffix += "-#{row_index + 1}" if row_index
|
||||
end
|
||||
suffix = "-#{index + 1}"
|
||||
suffix += "-#{row_index + 1}" if row_index.present?
|
||||
|
||||
suffix + attachment.filename.extension_with_delimiter
|
||||
end
|
||||
|
|
|
@ -544,7 +544,7 @@ describe ProcedureExportService do
|
|||
structure = [
|
||||
"#{base_fn}/",
|
||||
"#{base_fn}/dossier-#{dossier.id}/",
|
||||
"#{base_fn}/dossier-#{dossier.id}/piece_justificative-#{dossier.id}.txt",
|
||||
"#{base_fn}/dossier-#{dossier.id}/piece_justificative-#{dossier.id}-1.txt",
|
||||
"#{base_fn}/dossier-#{dossier.id}/export_#{dossier.id}.pdf"
|
||||
]
|
||||
expect(files.size).to eq(structure.size)
|
||||
|
|
Loading…
Reference in a new issue