Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/requests/api/ci/secure_files_spec.rb')
-rw-r--r--spec/requests/api/ci/secure_files_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/requests/api/ci/secure_files_spec.rb b/spec/requests/api/ci/secure_files_spec.rb
index f1f22dfadc2..0b8116d5e20 100644
--- a/spec/requests/api/ci/secure_files_spec.rb
+++ b/spec/requests/api/ci/secure_files_spec.rb
@@ -341,6 +341,15 @@ RSpec.describe API::Ci::SecureFiles do
expect(response).to have_gitlab_http_status(:payload_too_large)
end
+
+ it 'returns an error when and invalid file name is supplied' do
+ params = file_params.merge(name: '../../upload-keystore.jks')
+ expect do
+ post api("/projects/#{project.id}/secure_files", maintainer), params: params
+ end.not_to change { project.secure_files.count }
+
+ expect(response).to have_gitlab_http_status(:internal_server_error)
+ end
end
context 'authenticated user with read permissions' do