diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-24 03:11:30 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-24 03:11:30 +0300 |
commit | 1dd92924325105bb04d8900ac2577e59eb39f603 (patch) | |
tree | 0639fdc40eb357eb3fab79155e1e59076fbc1cec /spec/presenters | |
parent | a0686b4653208e66c768b63e249bd73406f9e267 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/presenters')
-rw-r--r-- | spec/presenters/ml/model_presenter_spec.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/presenters/ml/model_presenter_spec.rb b/spec/presenters/ml/model_presenter_spec.rb index 88bfa9eb4c6..991606c3b08 100644 --- a/spec/presenters/ml/model_presenter_spec.rb +++ b/spec/presenters/ml/model_presenter_spec.rb @@ -6,6 +6,7 @@ RSpec.describe Ml::ModelPresenter, feature_category: :mlops do let_it_be(:project) { build_stubbed(:project) } let_it_be(:model1) { build_stubbed(:ml_models, project: project) } 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) } describe '#latest_version_name' do subject { model.present.latest_version_name } @@ -25,6 +26,22 @@ RSpec.describe Ml::ModelPresenter, feature_category: :mlops do end end + describe '#version_count' do + subject { model3.present.version_count } + + it { is_expected.to eq(2) } + + context 'when model has precomputed version count' do + before do + allow(model3).to receive(:version_count).and_return(1) + end + + it 'returns the value of model version count' do + is_expected.to eq(1) + end + end + end + describe '#latest_package_path' do subject { model.present.latest_package_path } |