Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/factories/ml/models.rb')
-rw-r--r--spec/factories/ml/models.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/factories/ml/models.rb b/spec/factories/ml/models.rb
index 2d1b29289a5..158c26499b0 100644
--- a/spec/factories/ml/models.rb
+++ b/spec/factories/ml/models.rb
@@ -6,5 +6,17 @@ FactoryBot.define do
project
default_experiment { association :ml_experiments, project_id: project.id, name: name }
+
+ trait :with_versions do
+ versions { Array.new(2) { association(:ml_model_versions, model: instance) } }
+ end
+
+ trait :with_latest_version_and_package do
+ transient do
+ version { association(:ml_model_versions, :with_package, model: instance) }
+ end
+ versions { [version] }
+ latest_version { version }
+ end
end
end