scinote-web/spec/factories/experiments.rb

20 lines
495 B
Ruby
Raw Normal View History

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 }
factory :experiment_with_tasks do
after(:create) do |e|
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