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/services/ml')
-rw-r--r--spec/services/ml/create_model_service_spec.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/spec/services/ml/create_model_service_spec.rb b/spec/services/ml/create_model_service_spec.rb
index 74c1dd5fec7..88e7c00d1f9 100644
--- a/spec/services/ml/create_model_service_spec.rb
+++ b/spec/services/ml/create_model_service_spec.rb
@@ -50,9 +50,10 @@ RSpec.describe ::Ml::CreateModelService, feature_category: :mlops do
let(:name) { existing_model.name }
let(:project) { existing_model.project }
- it 'raises an error', :aggregate_failures do
- expect { create_model }.to raise_error(ActiveRecord::RecordInvalid)
+ it 'returns a model with errors', :aggregate_failures do
+ expect(create_model).not_to be_persisted
expect(Gitlab::InternalEvents).not_to have_received(:track_event)
+ expect(create_model.errors.full_messages).to eq(["Name has already been taken"])
end
end