diff options
author | GitLab Release Tools Bot <delivery-team+release-tools@gitlab.com> | 2023-08-31 19:41:43 +0300 |
---|---|---|
committer | GitLab Release Tools Bot <delivery-team+release-tools@gitlab.com> | 2023-08-31 19:41:43 +0300 |
commit | f0a2a6e328ab823ae6ba9eda7b4198b6ef7954c7 (patch) | |
tree | bae088e8db79a417b623f75df78e84ff11c36720 /spec/requests/api/bulk_imports_spec.rb | |
parent | 4432289851dcfc0bc030323f581866103fd12f66 (diff) | |
parent | 098480e7f30e1ca20e9095390f48edea76c069ed (diff) |
Merge remote-tracking branch 'dev/16-2-stable' into 16-2-stable
Diffstat (limited to 'spec/requests/api/bulk_imports_spec.rb')
-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) |