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-12-08 10:11:58 +01:00
|
|
|
after(:build) do |procedure, _evaluator|
|
2015-12-08 11:18:49 +01:00
|
|
|
if procedure.module_api_carto.nil?
|
|
|
|
module_api_carto = create(:module_api_carto)
|
|
|
|
procedure.module_api_carto = module_api_carto
|
|
|
|
end
|
2015-12-08 10:11:58 +01:00
|
|
|
end
|
|
|
|
|
2015-11-19 16:47:56 +01:00
|
|
|
trait :with_api_carto do
|
2015-12-08 10:11:58 +01:00
|
|
|
after(:build) do |procedure, _evaluator|
|
|
|
|
procedure.module_api_carto.use_api_carto = true
|
|
|
|
end
|
2015-11-19 16:47:56 +01:00
|
|
|
end
|
|
|
|
|
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
|