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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-06-11 15:08:54 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-06-11 15:08:54 +0300
commit0526dc1e681db465189573d0931610c049206106 (patch)
tree8d4241fc85ea1041b259a8c1ec4d4656adb26188 /spec/requests
parenta64fb464b4081ec468da3fec97dfdede1fbd55e7 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/api/projects_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb
index 5af4ad020fc..c3f29ec47a9 100644
--- a/spec/requests/api/projects_spec.rb
+++ b/spec/requests/api/projects_spec.rb
@@ -2516,6 +2516,21 @@ describe API::Projects do
expect(json_response['container_expiration_policy']['keep_n']).to eq(1)
expect(json_response['container_expiration_policy']['name_regex_keep']).to eq('foo.*')
end
+
+ it "doesn't update container_expiration_policy with invalid regex" do
+ project_param = {
+ container_expiration_policy_attributes: {
+ cadence: '1month',
+ keep_n: 1,
+ name_regex_keep: '['
+ }
+ }
+
+ put api("/projects/#{project3.id}", user4), params: project_param
+
+ expect(response).to have_gitlab_http_status(:bad_request)
+ expect(json_response['message']['container_expiration_policy.name_regex_keep']).to contain_exactly('not valid RE2 syntax: missing ]: [')
+ end
end
context 'when authenticated as project developer' do