diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2024-01-03 18:11:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2024-01-03 18:11:11 +0300 |
commit | 5429e3d4e0d5f1601ff8989bcb26bd822b3c7c5a (patch) | |
tree | 0f08e912ce115cd8ad0a5bdc0717fc64aae59c85 /spec/requests | |
parent | 3682bf2cf22082c9b57c99b50816fdfe98629792 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/requests')
-rw-r--r-- | spec/requests/projects/ml/models_controller_spec.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/requests/projects/ml/models_controller_spec.rb b/spec/requests/projects/ml/models_controller_spec.rb index cda3f777a72..e469ee837bc 100644 --- a/spec/requests/projects/ml/models_controller_spec.rb +++ b/spec/requests/projects/ml/models_controller_spec.rb @@ -152,6 +152,27 @@ RSpec.describe Projects::Ml::ModelsController, feature_category: :mlops do end end + describe 'GET new' do + subject(:create_model_request) do + new_model + response + end + + before do + create_model_request + end + + it 'renders the template' do + is_expected.to render_template('projects/ml/models/new') + end + + context 'when user does not have access' do + let(:write_model_registry) { false } + + it { is_expected.to have_gitlab_http_status(:not_found) } + end + end + describe 'destroy' do let(:model_for_deletion) do create(:ml_models, project: project) @@ -198,4 +219,8 @@ RSpec.describe Projects::Ml::ModelsController, feature_category: :mlops do def delete_model delete project_ml_model_path(project, model_id) end + + def new_model + get new_project_ml_model_path(project) + end end |