diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2019-06-06 11:34:34 +0000 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2019-06-06 11:34:34 +0000 |
commit | 102c0e81fc7f90f4a57bfba30f554423f9d04802 (patch) | |
tree | 153b8612f4602b04b8bb07fbe9275901ff13216b | |
parent | 52e88dfee770e17ee227d29e3731880bcb070a87 (diff) | |
parent | 076e16cb1c6533275d46a4542054947b2c3b2042 (diff) | |
download | gitlab-ce-102c0e81fc7f90f4a57bfba30f554423f9d04802.tar.gz |
Merge branch 'enforce-template-uniqueness' into 'master'
Ensure that template is used once
See merge request gitlab-org/gitlab-ce!27511
-rw-r--r-- | spec/lib/gitlab/template/gitlab_ci_yml_template_spec.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/lib/gitlab/template/gitlab_ci_yml_template_spec.rb b/spec/lib/gitlab/template/gitlab_ci_yml_template_spec.rb index fe46c67a920..5f0a7e925ca 100644 --- a/spec/lib/gitlab/template/gitlab_ci_yml_template_spec.rb +++ b/spec/lib/gitlab/template/gitlab_ci_yml_template_spec.rb @@ -15,6 +15,13 @@ describe Gitlab::Template::GitlabCiYmlTemplate do expect(all).to include('Docker') expect(all).to include('Ruby') end + + it 'ensure that the template name is used exactly once' do + all = subject.all.group_by(&:name) + duplicates = all.select { |_, templates| templates.length > 1 } + + expect(duplicates).to be_empty + end end describe '.find' do |