debian-mirror-gitlab/spec/factories/ml/experiments.rb
2023-03-04 22:38:38 +05:30

15 lines
404 B
Ruby

# frozen_string_literal: true
FactoryBot.define do
factory :ml_experiments, class: '::Ml::Experiment' do
sequence(:name) { |n| "experiment#{n}" }
project
user { project&.creator }
trait :with_metadata do
after(:create) do |e|
e.metadata = FactoryBot.create_list(:ml_experiment_metadata, 2, experiment: e) # rubocop:disable StrategyInCallback
end
end
end
end