convert sheet_name to ascii before tuncate to 30 to ensure length < 31 bytes
This commit is contained in:
parent
29ef5e6785
commit
1eb780b0c9
2 changed files with 7 additions and 3 deletions
|
@ -73,7 +73,11 @@ class ProcedureExportService
|
|||
{ instances: table.last, sheet_name: table.first }
|
||||
end.merge(DEFAULT_STYLES)
|
||||
|
||||
options[:sheet_name] = options[:sheet_name].truncate(30)
|
||||
# transliterate: convert to ASCII characteres
|
||||
# to ensure truncate respects 30 bytes
|
||||
options[:sheet_name] = I18n.transliterate(options[:sheet_name], '')
|
||||
.truncate(30, omission: '')
|
||||
|
||||
options
|
||||
end
|
||||
end
|
||||
|
|
|
@ -356,10 +356,10 @@ describe ProcedureExportService do
|
|||
end
|
||||
end
|
||||
|
||||
context 'with long libelle' do
|
||||
context 'with long libelle composed of utf8 characteres' do
|
||||
before do
|
||||
procedure.types_de_champ.each do |c|
|
||||
c.update!(libelle: "#{c.id} - Quam rem nam maiores numquam dolorem nesciunt. Cum et possimus et aut. Fugit voluptas qui qui.")
|
||||
c.update!(libelle: "#{c.id} - éééé ééé ééé ééééééé ééééééé ééééééé éééééééé. ééé éé éééééééé éé ééé. ééééé éééééééé ééé ééé.")
|
||||
end
|
||||
champ_repetition.champs.each do |c|
|
||||
c.type_de_champ.update!(libelle: "#{c.id} - Quam rem nam maiores numquam dolorem nesciunt. Cum et possimus et aut. Fugit voluptas qui qui.")
|
||||
|
|
Loading…
Reference in a new issue