diff options
Diffstat (limited to 'spec/lib/gitlab/checks/tag_check_spec.rb')
-rw-r--r-- | spec/lib/gitlab/checks/tag_check_spec.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/lib/gitlab/checks/tag_check_spec.rb b/spec/lib/gitlab/checks/tag_check_spec.rb index e75b0459337..60d3eb4bfb3 100644 --- a/spec/lib/gitlab/checks/tag_check_spec.rb +++ b/spec/lib/gitlab/checks/tag_check_spec.rb @@ -15,6 +15,12 @@ RSpec.describe Gitlab::Checks::TagCheck, feature_category: :source_code_manageme end context "prohibited tags check" do + it 'prohibits tags name that include refs/heads at the head' do + allow(subject).to receive(:tag_name).and_return("refs/heads/foo") + + expect { subject.validate! }.to raise_error(Gitlab::GitAccess::ForbiddenError, "You cannot create a tag with a prohibited pattern.") + end + it "prohibits tag names that include refs/tags/ at the head" do allow(subject).to receive(:tag_name).and_return("refs/tags/foo") |