2015-08-13 15:55:19 +02:00
|
|
|
FactoryGirl.define do
|
|
|
|
factory :dossier do
|
2015-09-22 15:00:59 +02:00
|
|
|
nom_projet "Demande de subvention dans le cadre d'accompagnement d'enfant à l'étranger"
|
2015-09-24 10:17:59 +02:00
|
|
|
state 'draft'
|
2015-11-03 15:27:49 +01:00
|
|
|
|
2015-08-13 15:55:19 +02:00
|
|
|
trait :with_entreprise do
|
2015-08-20 16:25:54 +02:00
|
|
|
after(:build) do |dossier, _evaluator|
|
2015-08-13 15:55:19 +02:00
|
|
|
etablissement = create(:etablissement)
|
|
|
|
entreprise = create(:entreprise, etablissement: etablissement)
|
|
|
|
dossier.entreprise = entreprise
|
|
|
|
dossier.etablissement = etablissement
|
|
|
|
end
|
|
|
|
end
|
2015-09-21 17:59:03 +02:00
|
|
|
|
|
|
|
trait :with_procedure do
|
|
|
|
after(:build) do |dossier, _evaluator|
|
2015-11-05 11:21:44 +01:00
|
|
|
procedure = create(:procedure, :with_two_type_de_piece_justificative, :with_type_de_champ)
|
2015-09-21 17:59:03 +02:00
|
|
|
dossier.procedure = procedure
|
|
|
|
end
|
|
|
|
end
|
2015-09-23 19:20:03 +02:00
|
|
|
|
|
|
|
trait :with_user do
|
|
|
|
after(:build) do |dossier, _evaluator|
|
|
|
|
dossier.user = create(:user)
|
|
|
|
end
|
|
|
|
end
|
2015-08-13 15:55:19 +02:00
|
|
|
end
|
2015-08-20 17:30:17 +02:00
|
|
|
end
|