diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2019-04-19 16:44:05 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2019-06-06 13:18:50 +0300 |
commit | 076e16cb1c6533275d46a4542054947b2c3b2042 (patch) | |
tree | 124f23b4b8783f0ea93c2df823ffd8b4c269470f /spec/lib/gitlab/template | |
parent | 26d57f96410d474dff2e57b31cdd47764ff7b05b (diff) |
Ensure that template is used once
This adds additional test that make sure that each
template name is used exactly once across all folders
exposed
Diffstat (limited to 'spec/lib/gitlab/template')
-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 |