demarches-normaliennes/spec/factories/dossier.rb
Xavier J 8693f4194c Merge branch 'develop' of ssh://37.187.249.111:2200/opt/git/tps into develop
Conflicts:
	app/views/users/recapitulatif/show.html.haml
	spec/features/recapitulatif_page/_commentaires_flux_spec.rb
	spec/features/recapitulatif_page/show_page_spec.rb
2015-09-24 10:56:12 +02:00

27 lines
797 B
Ruby

FactoryGirl.define do
factory :dossier do
nom_projet "Demande de subvention dans le cadre d'accompagnement d'enfant à l'étranger"
state 'draft'
trait :with_entreprise do
after(:build) do |dossier, _evaluator|
etablissement = create(:etablissement)
entreprise = create(:entreprise, etablissement: etablissement)
dossier.entreprise = entreprise
dossier.etablissement = etablissement
end
end
trait :with_procedure do
after(:build) do |dossier, _evaluator|
procedure = create(:procedure, :with_two_type_de_piece_justificative)
dossier.procedure = procedure
end
end
trait :with_user do
after(:build) do |dossier, _evaluator|
dossier.user = create(:user)
end
end
end
end