diff options
author | Dylan Griffith <dyl.griffith@gmail.com> | 2017-11-19 06:01:01 +0300 |
---|---|---|
committer | Dylan Griffith <dyl.griffith@gmail.com> | 2018-02-13 03:07:12 +0300 |
commit | 06c111ca8f4373069ad0d3bbcf9e1ce2f5fd6d97 (patch) | |
tree | b96adc4b337cc42a436e6b4baec44527d9fd76cc /spec/lib | |
parent | 498ade4801a822f8704390b10d178af9fe7987cb (diff) |
Ensure users can't create environments with leading or trailing slashes (Fixes #39885)
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/gitlab/regex_spec.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/lib/gitlab/regex_spec.rb b/spec/lib/gitlab/regex_spec.rb index 8b54d72d6f7..a1079e54975 100644 --- a/spec/lib/gitlab/regex_spec.rb +++ b/spec/lib/gitlab/regex_spec.rb @@ -18,6 +18,7 @@ describe Gitlab::Regex do subject { described_class.environment_name_regex } it { is_expected.to match('foo') } + it { is_expected.to match('a') } it { is_expected.to match('foo-1') } it { is_expected.to match('FOO') } it { is_expected.to match('foo/1') } @@ -25,6 +26,10 @@ describe Gitlab::Regex do it { is_expected.not_to match('9&foo') } it { is_expected.not_to match('foo-^') } it { is_expected.not_to match('!!()()') } + it { is_expected.not_to match('/foo') } + it { is_expected.not_to match('foo/') } + it { is_expected.not_to match('/foo/') } + it { is_expected.not_to match('/') } end describe '.environment_slug_regex' do |