diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-19 21:07:43 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-19 21:07:43 +0300 |
commit | 1e1012d3d28c426637eecc0909c415fe2c8b7c3a (patch) | |
tree | d230780752bb3b98cf4f3ede1c6f8e98c9a238c7 /spec/requests | |
parent | 3c55affa6684311ca73bc4e3d3bfb17b7541f63b (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 | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/spec/requests/projects/ml/models_controller_spec.rb b/spec/requests/projects/ml/models_controller_spec.rb index b4402ad9a27..936aed59e39 100644 --- a/spec/requests/projects/ml/models_controller_spec.rb +++ b/spec/requests/projects/ml/models_controller_spec.rb @@ -33,7 +33,7 @@ RSpec.describe Projects::Ml::ModelsController, feature_category: :mlops do end it 'fetches the models using the finder' do - expect(::Projects::Ml::ModelFinder).to receive(:new).with(project).and_call_original + expect(::Projects::Ml::ModelFinder).to receive(:new).with(project, {}).and_call_original index_request end @@ -61,6 +61,22 @@ RSpec.describe Projects::Ml::ModelsController, feature_category: :mlops do end end + context 'with search params' do + let(:params) { { name: 'some_name', order_by: 'name', sort: 'asc' } } + + it 'passes down params to the finder' do + expect(Projects::Ml::ModelFinder).to receive(:new).and_call_original do |_exp, params| + expect(params.to_h).to include({ + name: 'some_name', + order_by: 'name', + sort: 'asc' + }) + end + + index_request + end + end + describe 'pagination' do before do stub_const("Projects::Ml::ModelsController::MAX_MODELS_PER_PAGE", 2) |