2019-01-10 01:30:33 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-01-23 21:54:15 +08:00
|
|
|
FactoryBot.define do
|
2017-07-28 16:14:50 +08:00
|
|
|
factory :my_module do
|
2019-01-10 01:30:33 +08:00
|
|
|
sequence(:name) { |n| "Task-#{n}" }
|
2019-09-12 23:21:48 +08:00
|
|
|
x { Faker::Number.between(from: 1, to: 100) }
|
2019-09-16 15:31:30 +08:00
|
|
|
sequence(:y) { |n| n }
|
2019-01-11 17:16:50 +08:00
|
|
|
workflow_order { MyModule.where(experiment_id: experiment.id).count + 1 }
|
2019-01-10 01:30:33 +08:00
|
|
|
experiment
|
|
|
|
my_module_group { create :my_module_group, experiment: experiment }
|
2019-01-15 20:45:05 +08:00
|
|
|
trait :with_tag do
|
|
|
|
tags { create_list :tag, 3, project: experiment.project }
|
|
|
|
end
|
2019-03-12 00:17:59 +08:00
|
|
|
trait :with_due_date do
|
2019-09-12 23:21:48 +08:00
|
|
|
due_date { Faker::Time.between(from: Date.today, to: Date.today + 10.days) }
|
2019-03-12 00:17:59 +08:00
|
|
|
end
|
2017-07-28 16:14:50 +08:00
|
|
|
end
|
|
|
|
end
|