demarches-normaliennes/spec/factories/commentaire.rb

16 lines
386 B
Ruby
Raw Normal View History

2018-01-23 17:15:42 +01:00
FactoryBot.define do
factory :commentaire do
2018-09-04 16:46:48 +02:00
body { 'plop' }
2016-12-26 18:37:27 +01:00
before(:create) do |commentaire, _evaluator|
2018-01-11 19:04:39 +01:00
if !commentaire.dossier
commentaire.dossier = create :dossier, :en_construction
2016-12-26 18:37:27 +01:00
end
end
trait :with_file do
2019-11-20 15:54:53 +01:00
piece_jointe { Rack::Test::UploadedFile.new("./spec/fixtures/files/logo_test_procedure.png", 'image/png') }
end
end
2015-08-20 17:30:17 +02:00
end