Skip to content

Commit

Permalink
Ensure that template is used once
Browse files Browse the repository at this point in the history
This adds additional test that make sure that each
template name is used exactly once across all folders
exposed
  • Loading branch information
ayufan committed Jun 6, 2019
1 parent 26d57f9 commit 076e16c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions spec/lib/gitlab/template/gitlab_ci_yml_template_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@
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
Expand Down

0 comments on commit 076e16c

Please sign in to comment.