From ba25c7ef51673db933439a6a2b1503d7c12bec14 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 30 Aug 2023 19:43:20 +0000 Subject: Add latest changes from gitlab-org/security/gitlab@16-2-stable-ee --- spec/requests/api/bulk_imports_spec.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'spec/requests/api/bulk_imports_spec.rb') diff --git a/spec/requests/api/bulk_imports_spec.rb b/spec/requests/api/bulk_imports_spec.rb index b159d4ad445..fdbfbf052d0 100644 --- a/spec/requests/api/bulk_imports_spec.rb +++ b/spec/requests/api/bulk_imports_spec.rb @@ -248,6 +248,20 @@ RSpec.describe API::BulkImports, feature_category: :importers do end end + context 'when the destination_namespace is invalid' do + it 'returns invalid error' do + params[:entities][0][:destination_namespace] = 'dest?nation-namespace' + + request + expect(response).to have_gitlab_http_status(:bad_request) + expect(json_response['error']).to include('entities[0][destination_namespace] must have a relative path ' \ + 'structure with no HTTP protocol characters, or leading or ' \ + 'trailing forward slashes. Path segments must not start or end ' \ + 'with a special character, and must not contain consecutive ' \ + 'special characters.') + end + end + context 'when the destination_slug is invalid' do it 'returns invalid error when restricting special characters is disabled' do Feature.disable(:restrict_special_characters_in_namespace_path) -- cgit v1.2.3