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/presenters/ml/candidate_presenter_spec.rb')
-rw-r--r--spec/presenters/ml/candidate_presenter_spec.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/presenters/ml/candidate_presenter_spec.rb b/spec/presenters/ml/candidate_presenter_spec.rb
new file mode 100644
index 00000000000..f24b53d84e8
--- /dev/null
+++ b/spec/presenters/ml/candidate_presenter_spec.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe Ml::CandidatePresenter, feature_category: :mlops do
+ let_it_be(:project) { build_stubbed(:project) }
+ let_it_be(:candidate) { build_stubbed(:ml_candidates, :with_artifact, internal_id: 1, project: project) }
+ let_it_be(:presenter) { candidate.present }
+
+ describe '#path' do
+ subject { presenter.path }
+
+ it { is_expected.to eq("/#{project.full_path}/-/ml/candidates/#{candidate.iid}") }
+ end
+
+ describe '#artifact_path' do
+ subject { presenter.artifact_path }
+
+ it { is_expected.to eq("/#{project.full_path}/-/packages/#{candidate.package_id}") }
+ end
+end