diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-30 22:45:17 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-30 22:45:17 +0300 |
commit | 1cad287a7b40174786cadaecea9c91a68e49fcba (patch) | |
tree | 7cdc2447c143cec003eb7c0e42a324f26902bc5d /spec/requests | |
parent | 1fb0bae24e6686b3571fc1c44cbf239d8563e0d7 (diff) |
Add latest changes from gitlab-org/security/gitlab@16-3-stable-ee
Diffstat (limited to 'spec/requests')
-rw-r--r-- | spec/requests/api/bulk_imports_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
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) |