summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <zegerjan@gitlab.com>2017-06-21 11:16:38 +0000
committerGrzegorz Bizon <grzegorz@gitlab.com>2017-06-21 11:16:38 +0000
commit5eb940da76193524bd81d006fee9f7971c750ec0 (patch)
tree48febd53a6b70681d80c2eb1457eaa7297873cb7 /spec
parent6a3da45a22165f2f71c023e0656ff07820a1e60e (diff)
downloadgitlab-ce-5eb940da76193524bd81d006fee9f7971c750ec0.tar.gz
Replace invalid chars while seeding environments
Diffstat (limited to 'spec')
-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') }