Merge branch 'enforce-template-uniqueness' into 'master'

Ensure that template is used once

See merge request gitlab-org/gitlab-ce!27511
This commit is contained in:
Grzegorz Bizon 2019-06-06 11:34:34 +00:00
commit 102c0e81fc
1 changed files with 7 additions and 0 deletions

View File

@ -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