summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-09-28 22:05:12 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-09-28 22:05:22 +0000
commit10d9a3bf50cca85dd857c5306a34d7a6032580e6 (patch)
tree9ecd7fbf59c0e43c143c1d46fd437a9810aa6067 /spec/lib/gitlab
parent6ed97cad88c8518155867b9a6a7896d7085a2f4e (diff)
downloadgitlab-ce-10d9a3bf50cca85dd857c5306a34d7a6032580e6.tar.gz
Add latest changes from gitlab-org/security/gitlab@15-4-stable-ee
Diffstat (limited to 'spec/lib/gitlab')
-rw-r--r--spec/lib/gitlab/checks/tag_check_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/lib/gitlab/checks/tag_check_spec.rb b/spec/lib/gitlab/checks/tag_check_spec.rb
index 6cd3a2d1c07..50ffa5fad10 100644
--- a/spec/lib/gitlab/checks/tag_check_spec.rb
+++ b/spec/lib/gitlab/checks/tag_check_spec.rb
@@ -81,6 +81,14 @@ RSpec.describe Gitlab::Checks::TagCheck do
it 'allows tag creation' do
expect { subject.validate! }.not_to raise_error
end
+
+ context 'when tag name is the same as default branch' do
+ let(:ref) { "refs/tags/#{project.default_branch}" }
+
+ it 'is prevented' do
+ expect { subject.validate! }.to raise_error(Gitlab::GitAccess::ForbiddenError, /cannot use default branch name to create a tag/)
+ end
+ end
end
end
end