demarches-normaliennes/spec/factories/commentaire.rb
2019-07-17 14:43:41 +02:00

15 lines
378 B
Ruby

FactoryBot.define do
factory :commentaire do
body { 'plop' }
before(:create) do |commentaire, _evaluator|
if !commentaire.dossier
commentaire.dossier = create :dossier, :en_construction
end
end
trait :with_file do
file { Rack::Test::UploadedFile.new("./spec/fixtures/files/logo_test_procedure.png", 'image/png') }
end
end
end