2020-07-18 00:04:09 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
FactoryBot.define do
|
|
|
|
factory :my_module_status do
|
|
|
|
name { Faker::Name.unique.name }
|
|
|
|
description { Faker::Lorem.sentence }
|
|
|
|
color { Faker::Color.hex_color }
|
|
|
|
my_module_status_flow
|
2020-08-18 22:27:07 +08:00
|
|
|
trait :with_consequence do
|
|
|
|
after(:create) do |status|
|
|
|
|
create :my_module_status_consequence, my_module_status: status
|
|
|
|
end
|
|
|
|
end
|
|
|
|
trait :with_conditions do
|
|
|
|
after(:create) do |status|
|
|
|
|
create :my_module_status_condition, my_module_status: status
|
|
|
|
end
|
|
|
|
end
|
|
|
|
trait :with_implications do
|
|
|
|
after(:create) do |status|
|
|
|
|
create :my_module_status_implication, my_module_status: status
|
|
|
|
end
|
|
|
|
end
|
2020-07-18 00:04:09 +08:00
|
|
|
end
|
|
|
|
end
|