fix unit tests

This commit is contained in:
clemkeirua 2020-06-24 10:55:53 +02:00
parent 5c39f22417
commit 465449e684
4 changed files with 25 additions and 5 deletions

View file

@ -1,5 +1,9 @@
FactoryBot.define do
factory :drop_down_list do
value { "val1\r\nval2\r\n--separateur--\r\nval3" }
trait :long do
value { "alpha\r\nbravo\r\n--separateur--\r\ncharly\r\ndelta\r\necho\r\nfox-trot\r\ngolf" }
end
end
end

View file

@ -233,6 +233,8 @@ FactoryBot.define do
end
build(:"type_de_champ_#{type_champ}", mandatory: true, libelle: libelle, order_place: index)
end
procedure.types_de_champ << build(:type_de_champ_drop_down_list, :long, mandatory: true, libelle: 'simple_choice_drop_down_list_long')
procedure.types_de_champ << build(:type_de_champ_multiple_drop_down_list, :long, mandatory: true, libelle: 'multiple_choice_drop_down_list_long')
end
end

View file

@ -53,10 +53,16 @@ FactoryBot.define do
libelle { 'Menu déroulant' }
type_champ { TypeDeChamp.type_champs.fetch(:drop_down_list) }
drop_down_list { create(:drop_down_list) }
trait :long do
drop_down_list { create(:drop_down_list, :long) }
end
end
factory :type_de_champ_multiple_drop_down_list do
type_champ { TypeDeChamp.type_champs.fetch(:multiple_drop_down_list) }
drop_down_list { create(:drop_down_list) }
trait :long do
drop_down_list { create(:drop_down_list, :long) }
end
end
factory :type_de_champ_linked_drop_down_list do
type_champ { TypeDeChamp.type_champs.fetch(:linked_drop_down_list) }