Refactor GitlabCiYmlTemplate specs to assert the exact search results
Problem
We currently have the behavior of the templates finder split out into two locations:
- https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/template/gitlab_ci_yml_template.rb
- https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/lib/ee/gitlab/template/gitlab_ci_yml_template.rb
and their respective spec files:
- https://gitlab.com/gitlab-org/gitlab/-/blob/master/spec/lib/gitlab/template/gitlab_ci_yml_template_spec.rb
- https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/spec/lib/ee/gitlab/template/gitlab_ci_yml_template_spec.rb
which are not as clear as they can be. The specs in EE that ensure EE templates are made available are good, but the Core specs could be more explicit in which default templates we expect to be available in Core. This ambiguity has lead to at least one logical bug in licensing so far: https://gitlab.com/gitlab-org/gitlab/-/issues/6151 (security-related confidential issue), which is no longer a problem but we should try to avoid doing that again.
Proposal
Remove individual assertions from the specs that deal with a single template, and assert an exact match of the collection of available templates. This way, the spec will be required to maintain a list of what is and is not available. If an additional template accidentally becomes available, we'll know right away before the change is merged.