mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-14 21:24:54 +08:00
25 lines
607 B
Ruby
25 lines
607 B
Ruby
# frozen_string_literal: true
|
|
|
|
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 }
|
|
trait :with_tasks do
|
|
after(:create) do |e|
|
|
create_list :my_module, 3, :with_tag, experiment: e
|
|
end
|
|
end
|
|
|
|
trait :archived do
|
|
archived { true }
|
|
archived_on { Time.zone.now }
|
|
archived_by { created_by }
|
|
end
|
|
end
|
|
end
|