summaryrefslogtreecommitdiff
path: root/spec/helpers/issuables_description_templates_helper_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/helpers/issuables_description_templates_helper_spec.rb')
-rw-r--r--spec/helpers/issuables_description_templates_helper_spec.rb21
1 files changed, 3 insertions, 18 deletions
diff --git a/spec/helpers/issuables_description_templates_helper_spec.rb b/spec/helpers/issuables_description_templates_helper_spec.rb
index 638dd201fc8..55649e9087a 100644
--- a/spec/helpers/issuables_description_templates_helper_spec.rb
+++ b/spec/helpers/issuables_description_templates_helper_spec.rb
@@ -56,32 +56,17 @@ RSpec.describe IssuablesDescriptionTemplatesHelper, :clean_gitlab_redis_cache do
let(:templates) do
{
"" => [
- { name: "another_issue_template", id: "another_issue_template" },
- { name: "custom_issue_template", id: "custom_issue_template" }
+ { name: "another_issue_template", id: "another_issue_template", project_id: project.id },
+ { name: "custom_issue_template", id: "custom_issue_template", project_id: project.id }
]
}
end
- it 'returns project templates only' do
+ it 'returns project templates' do
expect(helper.issuable_templates_names(Issue.new)).to eq(%w[another_issue_template custom_issue_template])
end
end
- context 'without matching project templates' do
- let(:templates) do
- {
- "Project Templates" => [
- { name: "another_issue_template", id: "another_issue_template", project_id: non_existing_record_id },
- { name: "custom_issue_template", id: "custom_issue_template", project_id: non_existing_record_id }
- ]
- }
- end
-
- it 'returns empty array' do
- expect(helper.issuable_templates_names(Issue.new)).to eq([])
- end
- end
-
context 'when there are not templates in the project' do
let(:templates) { {} }