diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-19 03:18:32 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-19 03:18:32 +0300 |
commit | f3b2c536778dcd0981134c702d97c6e4047b64d4 (patch) | |
tree | 46e885f18196164230d95fafd5381b371ffcdaa0 /spec/presenters | |
parent | 2d277754ebd347fd7c98a55d41f6c4de5e9920cc (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/presenters')
-rw-r--r-- | spec/presenters/ml/model_presenter_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/presenters/ml/model_presenter_spec.rb b/spec/presenters/ml/model_presenter_spec.rb index 31bf4e7ad6c..92398a8bb4d 100644 --- a/spec/presenters/ml/model_presenter_spec.rb +++ b/spec/presenters/ml/model_presenter_spec.rb @@ -8,6 +8,8 @@ RSpec.describe Ml::ModelPresenter, feature_category: :mlops do let_it_be(:model2) { build_stubbed(:ml_models, :with_latest_version_and_package, project: project) } let_it_be(:model3) { build_stubbed(:ml_models, :with_versions, project: project) } + let_it_be(:model4) { build_stubbed(:ml_models, project: project) } + describe '#latest_version_name' do subject { model.present.latest_version_name } @@ -42,6 +44,18 @@ RSpec.describe Ml::ModelPresenter, feature_category: :mlops do end end + describe '#candidate_count' do + let(:candidates) { build_stubbed_list(:ml_candidates, 2, experiment: model4.default_experiment) } + + before do + allow(model4).to receive(:candidates).and_return(candidates) + end + + subject { model4.present.candidate_count } + + it { is_expected.to eq(2) } + end + describe '#latest_package_path' do subject { model.present.latest_package_path } |