2019-01-10 01:30:33 +08:00
|
|
|
# frozen_string_literal: true
|
2017-07-28 16:14:50 +08:00
|
|
|
|
2019-01-10 01:30:33 +08:00
|
|
|
FactoryBot.define do
|
|
|
|
factory :experiment, class: Experiment do
|
|
|
|
transient do
|
|
|
|
user { create :user }
|
|
|
|
end
|
|
|
|
sequence(:name) { |n| "Experiment-#{n}" }
|
|
|
|
description { Faker::Lorem.sentence }
|
|
|
|
created_by { user }
|
|
|
|
last_modified_by { user }
|
|
|
|
project { create :project, created_by: user }
|
2019-03-12 00:17:59 +08:00
|
|
|
trait :experiment_with_tasks do
|
2019-01-10 01:30:33 +08:00
|
|
|
after(:create) do |e|
|
2019-01-15 20:45:05 +08:00
|
|
|
create_list :my_module, 3, :with_tag, experiment: e
|
2019-01-10 01:30:33 +08:00
|
|
|
end
|
|
|
|
end
|
2017-07-28 16:14:50 +08:00
|
|
|
end
|
|
|
|
end
|