2015-09-21 17:59:03 +02:00
|
|
|
FactoryGirl.define do
|
|
|
|
factory :procedure do
|
|
|
|
lien_demarche 'http://localhost'
|
2015-09-22 11:56:14 +02:00
|
|
|
libelle 'Demande de subvention'
|
|
|
|
description "Demande de subvention à l'intention des associations"
|
2015-09-21 17:59:03 +02:00
|
|
|
|
2015-11-05 11:21:44 +01:00
|
|
|
trait :with_type_de_champ do
|
2015-10-27 17:31:08 +01:00
|
|
|
after(:build) do |procedure, _evaluator|
|
2015-11-05 11:21:44 +01:00
|
|
|
type_de_champ = create(:type_de_champ)
|
2015-10-27 17:31:08 +01:00
|
|
|
|
2015-11-05 11:21:44 +01:00
|
|
|
procedure.types_de_champ << type_de_champ
|
2015-10-27 17:31:08 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-09-21 17:59:03 +02:00
|
|
|
trait :with_two_type_de_piece_justificative do
|
|
|
|
after(:build) do |procedure, _evaluator|
|
|
|
|
rib = create(:type_de_piece_justificative, :rib)
|
2015-09-22 13:15:58 +02:00
|
|
|
msa = create(:type_de_piece_justificative, :msa)
|
2015-09-21 17:59:03 +02:00
|
|
|
|
|
|
|
procedure.types_de_piece_justificative << rib
|
2015-09-22 13:15:58 +02:00
|
|
|
procedure.types_de_piece_justificative << msa
|
2015-09-21 17:59:03 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|