Fix new failing tests

This commit is contained in:
Damien Le Thiec 2023-02-01 13:35:32 +01:00
parent a4645855d3
commit e7c78321d9
2 changed files with 3 additions and 1 deletions

View file

@ -75,6 +75,8 @@ class PrefillParams
end end
def repeatable_hashes def repeatable_hashes
return [] unless value.is_a?(Array)
value.map.with_index do |repetition, index| value.map.with_index do |repetition, index|
row = champ.rows[index] || champ.add_row(champ.dossier_revision) row = champ.rows[index] || champ.add_row(champ.dossier_revision)
JSON.parse(repetition).map do |key, value| JSON.parse(repetition).map do |key, value|

View file

@ -50,7 +50,7 @@ RSpec.describe TypesDeChamp::PrefillTypeDeChamp, type: :model do
context 'when the type de champ is prefillable' do context 'when the type de champ is prefillable' do
let(:type_de_champ) { build(:type_de_champ_email) } let(:type_de_champ) { build(:type_de_champ_email) }
it { expect(possible_values).to match([]) } it { expect(possible_values).to match(["Une adresse email"]) }
end end
end end