summaryrefslogtreecommitdiff
path: root/spec/models/environment_spec.rb
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2017-01-19 14:42:03 +0000
committerNick Thomas <nick@gitlab.com>2017-01-23 13:44:17 +0000
commite806bdaf6c3c212a711b5f573ca6bc97ffd50a80 (patch)
treef20904b252d8788c60ecd3a8212cd098a474d44b /spec/models/environment_spec.rb
parent2de5f511d153ae33a4ed6c21107cb21226ee9582 (diff)
downloadgitlab-ce-e806bdaf6c3c212a711b5f573ca6bc97ffd50a80.tar.gz
Avoid repeated dashes in $CI_ENVIRONMENT_SLUG
Diffstat (limited to 'spec/models/environment_spec.rb')
-rw-r--r--spec/models/environment_spec.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/models/environment_spec.rb b/spec/models/environment_spec.rb
index 96efe1696c3..20065a8d31e 100644
--- a/spec/models/environment_spec.rb
+++ b/spec/models/environment_spec.rb
@@ -288,6 +288,11 @@ describe Environment, models: true do
"1-foo" => "env-1-foo" + SUFFIX,
"1/foo" => "env-1-foo" + SUFFIX,
"foo-" => "foo" + SUFFIX,
+ "foo--bar" => "foo-bar" + SUFFIX,
+ "foo**bar" => "foo-bar" + SUFFIX,
+ "*-foo" => "env-foo" + SUFFIX,
+ "staging-12345678-" => "staging-12345678" + SUFFIX,
+ "staging-12345678-01234567" => "staging-12345678" + SUFFIX,
}.each do |name, matcher|
it "returns a slug matching #{matcher}, given #{name}" do
slug = described_class.new(name: name).generate_slug