2018-01-23 17:15:42 +01:00
|
|
|
FactoryBot.define do
|
2015-08-13 15:55:19 +02:00
|
|
|
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
|
2019-07-02 15:21:49 +02:00
|
|
|
commentaire.dossier = create :dossier, :en_construction
|
2016-12-26 18:37:27 +01:00
|
|
|
end
|
|
|
|
end
|
2019-06-25 17:12:44 +02:00
|
|
|
|
|
|
|
trait :with_file do
|
2019-07-17 14:24:48 +02:00
|
|
|
file { Rack::Test::UploadedFile.new("./spec/fixtures/files/logo_test_procedure.png", 'image/png') }
|
2019-06-25 17:12:44 +02:00
|
|
|
end
|
2015-08-13 15:55:19 +02:00
|
|
|
end
|
2015-08-20 17:30:17 +02:00
|
|
|
end
|