From 91a7f1897e7cb14d60c2aaf3afa76ebdc879d939 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 25 May 2023 09:09:38 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- spec/controllers/admin/dashboard_controller_spec.rb | 3 ++- spec/lib/bulk_imports/clients/http_spec.rb | 14 ++++++++++---- spec/support/rspec_order_todo.yml | 4 ++-- 3 files changed, 14 insertions(+), 7 deletions(-) (limited to 'spec') diff --git a/spec/controllers/admin/dashboard_controller_spec.rb b/spec/controllers/admin/dashboard_controller_spec.rb index bfbd2ca946f..e3d579a631c 100644 --- a/spec/controllers/admin/dashboard_controller_spec.rb +++ b/spec/controllers/admin/dashboard_controller_spec.rb @@ -11,7 +11,8 @@ RSpec.describe Admin::DashboardController do it 'retrieves Redis versions' do get :index - expect(assigns[:redis_versions].length).to eq(1) + # specs are run against both Redis and Redis Cluster instances. + expect(assigns[:redis_versions].length).to be > 0 end context 'with pending_delete projects' do diff --git a/spec/lib/bulk_imports/clients/http_spec.rb b/spec/lib/bulk_imports/clients/http_spec.rb index aff049408e2..bf1bfb77b26 100644 --- a/spec/lib/bulk_imports/clients/http_spec.rb +++ b/spec/lib/bulk_imports/clients/http_spec.rb @@ -33,11 +33,17 @@ RSpec.describe BulkImports::Clients::HTTP, feature_category: :importers do end context 'error handling' do - context 'when error occurred' do - it 'raises BulkImports::NetworkError' do - allow(Gitlab::HTTP).to receive(method).and_raise(Errno::ECONNREFUSED) + context 'when any known HTTP error occurs' do + using RSpec::Parameterized::TableSyntax + + where(:exception_class) { Gitlab::HTTP::HTTP_ERRORS } + + with_them do + it 'raises BulkImports::NetworkError' do + allow(Gitlab::HTTP).to receive(method).and_raise(exception_class) - expect { subject.public_send(method, resource) }.to raise_exception(BulkImports::NetworkError) + expect { subject.public_send(method, resource) }.to raise_exception(BulkImports::NetworkError) + end end end diff --git a/spec/support/rspec_order_todo.yml b/spec/support/rspec_order_todo.yml index ee0854c2483..01875aadacb 100644 --- a/spec/support/rspec_order_todo.yml +++ b/spec/support/rspec_order_todo.yml @@ -161,7 +161,7 @@ - './ee/spec/controllers/projects/subscriptions_controller_spec.rb' - './ee/spec/controllers/projects/vulnerability_feedback_controller_spec.rb' - './ee/spec/controllers/registrations/company_controller_spec.rb' -- './ee/spec/controllers/registrations/groups_projects_controller_spec.rb' +- './ee/spec/controllers/registrations/groups_controller_spec.rb' - './ee/spec/controllers/repositories/git_http_controller_spec.rb' - './ee/spec/controllers/security/dashboard_controller_spec.rb' - './ee/spec/controllers/security/projects_controller_spec.rb' @@ -3079,7 +3079,7 @@ - './ee/spec/views/projects/security/policies/index.html.haml_spec.rb' - './ee/spec/views/projects/security/sast_configuration/show.html.haml_spec.rb' - './ee/spec/views/projects/settings/subscriptions/_index.html.haml_spec.rb' -- './ee/spec/views/registrations/groups_projects/new.html.haml_spec.rb' +- './ee/spec/views/registrations/groups/new.html.haml_spec.rb' - './ee/spec/views/shared/billings/_billing_plan_actions.html.haml_spec.rb' - './ee/spec/views/shared/billings/_billing_plan.html.haml_spec.rb' - './ee/spec/views/shared/billings/_billing_plans.html.haml_spec.rb' -- cgit v1.2.3