scinote-web/spec/factories/experiments.rb
2019-03-12 09:15:06 +01:00

19 lines
493 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 :experiment_with_tasks do
after(:create) do |e|
create_list :my_module, 3, :with_tag, experiment: e
end
end
end
end