Refactor ChampSerializer
This commit is contained in:
parent
0b017580c5
commit
e374a5c726
11 changed files with 148 additions and 96 deletions
|
@ -28,4 +28,41 @@ FactoryBot.define do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
factory :champ_integer_number, class: 'Champs::IntegerNumberChamp' do
|
||||
type_de_champ { create(:type_de_champ_integer_number) }
|
||||
value { '42' }
|
||||
end
|
||||
|
||||
factory :champ_decimal_number, class: 'Champs::DecimalNumberChamp' do
|
||||
type_de_champ { create(:type_de_champ_decimal_number) }
|
||||
value { '42.1' }
|
||||
end
|
||||
|
||||
factory :champ_linked_drop_down_list, class: 'Champs::LinkedDropDownListChamp' do
|
||||
type_de_champ { create(:type_de_champ_linked_drop_down_list) }
|
||||
value { '{}' }
|
||||
end
|
||||
|
||||
factory :champ_carte, class: 'Champs::CarteChamp' do
|
||||
type_de_champ { create(:type_de_champ_carte) }
|
||||
end
|
||||
|
||||
factory :champ_siret, class: 'Champs::SiretChamp' do
|
||||
type_de_champ { create(:type_de_champ_siret) }
|
||||
value { '44011762001530' }
|
||||
etablissement { create(:etablissement) }
|
||||
|
||||
before(:create) do |champ, evaluator|
|
||||
champ.etablissement.signature = champ.etablissement.sign
|
||||
end
|
||||
end
|
||||
|
||||
factory :champ_piece_justificative, class: 'Champs::PieceJustificativeChamp' do
|
||||
type_de_champ { create(:type_de_champ_piece_justificative) }
|
||||
|
||||
after(:create) do |champ, evaluator|
|
||||
champ.piece_justificative_file.attach(io: StringIO.new("toto"), filename: "toto.txt", content_type: "text/plain")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue