diff options
Diffstat (limited to 'spec/services/ml/model_versions/get_model_version_service_spec.rb')
-rw-r--r-- | spec/services/ml/model_versions/get_model_version_service_spec.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/services/ml/model_versions/get_model_version_service_spec.rb b/spec/services/ml/model_versions/get_model_version_service_spec.rb new file mode 100644 index 00000000000..b46a0bf6d1d --- /dev/null +++ b/spec/services/ml/model_versions/get_model_version_service_spec.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe Ml::ModelVersions::GetModelVersionService, feature_category: :mlops do + let_it_be(:existing_version) { create(:ml_model_versions) } + let_it_be(:another_project) { create(:project) } + + subject(:model_version) { described_class.new(project, name, version).execute } + + describe '#execute' do + context 'when model version exists' do + let(:name) { existing_version.name } + let(:version) { existing_version.version } + let(:project) { existing_version.project } + + it { is_expected.to eq(existing_version) } + end + + context 'when model version does not exist' do + let(:project) { existing_version.project } + let(:name) { 'a_new_model' } + let(:version) { '2.0.0' } + + it { is_expected.to be_nil } + end + end +end |