diff options
Diffstat (limited to 'spec/presenters/ml/model_presenter_spec.rb')
-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 } |