From 59c808a636b74e9ddaae33dc1236af9b569e027f Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Wed, 19 Jul 2017 10:52:03 +0200 Subject: Add a test for container repository name regexp --- spec/lib/gitlab/regex_spec.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'spec/lib/gitlab/regex_spec.rb') diff --git a/spec/lib/gitlab/regex_spec.rb b/spec/lib/gitlab/regex_spec.rb index 51e2c3c38c6..251f82849bf 100644 --- a/spec/lib/gitlab/regex_spec.rb +++ b/spec/lib/gitlab/regex_spec.rb @@ -38,4 +38,15 @@ describe Gitlab::Regex, lib: true do it { is_expected.not_to match('9foo') } it { is_expected.not_to match('foo-') } end + + describe '.container_repository_name_regex' do + subject { described_class.container_repository_name_regex } + + it { is_expected.to match('image') } + it { is_expected.to match('my/image') } + it { is_expected.to match('my/awesome/image-1') } + it { is_expected.to match('my/awesome/image.test') } + it { is_expected.not_to match('.my/image') } + it { is_expected.not_to match('my/image.') } + end end -- cgit v1.2.3