summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/regex_spec.rb
diff options
context:
space:
mode:
authorPawel Chojnacki <pawel@chojnacki.ws>2017-06-22 15:05:52 +0200
committerPawel Chojnacki <pawel@chojnacki.ws>2017-06-22 15:05:52 +0200
commit97c42df3b804a37e659c3cda6bd8a52570f31366 (patch)
tree97c38db7f71a93a7b0db5ca2c682d6d17479cbdb /spec/lib/gitlab/regex_spec.rb
parent3833f1dd84dfec844443a5b1d9ba2bd2b911c0bc (diff)
parent11716f310dcc495600f5a17e08456a1abb296482 (diff)
downloadgitlab-ce-28717-additional-metrics-review-branch.tar.gz
Merge remote-tracking branch 'upstream/master' into 28717-additional-metrics-review-branch28717-additional-metrics-review-branch
Diffstat (limited to 'spec/lib/gitlab/regex_spec.rb')
-rw-r--r--spec/lib/gitlab/regex_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/lib/gitlab/regex_spec.rb b/spec/lib/gitlab/regex_spec.rb
index 0bee892fe0c..979f4fefcb6 100644
--- a/spec/lib/gitlab/regex_spec.rb
+++ b/spec/lib/gitlab/regex_spec.rb
@@ -21,6 +21,18 @@ describe Gitlab::Regex, lib: true do
end
describe '.environment_slug_regex' do
+ subject { described_class.environment_name_regex }
+
+ it { is_expected.to match('foo') }
+ it { is_expected.to match('foo-1') }
+ it { is_expected.to match('FOO') }
+ it { is_expected.to match('foo/1') }
+ it { is_expected.to match('foo.1') }
+ it { is_expected.not_to match('9&foo') }
+ it { is_expected.not_to match('foo-^') }
+ end
+
+ describe '.environment_slug_regex' do
subject { described_class.environment_slug_regex }
it { is_expected.to match('foo') }