diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-02-22 21:13:21 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-02-22 21:13:21 +0100 |
commit | e117b1b2c7d18f25e1b7094fd7edb5e12721b79d (patch) | |
tree | 42083a6cedc948d970f53aebbfe404dea87135bb /hugolib/taxonomy_test.go | |
parent | 9e6b5eb98e964acd8840482a29db72d5868c9b14 (diff) |
hugolib: Add terms' pages to .Data.Pages
Fixes #2826
Diffstat (limited to 'hugolib/taxonomy_test.go')
-rw-r--r-- | hugolib/taxonomy_test.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/hugolib/taxonomy_test.go b/hugolib/taxonomy_test.go index 209d8d2fe..bafb2c361 100644 --- a/hugolib/taxonomy_test.go +++ b/hugolib/taxonomy_test.go @@ -84,6 +84,7 @@ others: writeSource(t, fs, "content/p1.md", fmt.Sprintf(pageTemplate, "t1/c1", "- tag1", "- cat1", "- o1")) writeSource(t, fs, "content/p2.md", fmt.Sprintf(pageTemplate, "t2/c1", "- tag2", "- cat1", "- o1")) + writeSource(t, fs, "content/p3.md", fmt.Sprintf(pageTemplate, "t2/c12", "- tag2", "- cat2", "- o1")) writeNewContentFile(t, fs, "Category Terms", "2017-01-01", "content/categories/_index.md", 10) writeNewContentFile(t, fs, "Tag1 List", "2017-01-01", "content/tags/tag1/_index.md", 10) @@ -110,4 +111,15 @@ others: th.assertFileContent("public/others/o1/index.html", "List", "O1") th.assertFileContent("public/others/index.html", "Terms List", "Others") + s := h.Sites[0] + cat1 := s.getPage(KindTaxonomy, "categories", "cat1") + require.NotNil(t, cat1) + require.Len(t, cat1.Pages, 2) + + cat := s.getPage(KindTaxonomyTerm, "categories") + require.NotNil(t, cat) + require.Len(t, cat.Pages, 3) + require.Len(t, cat.Data["Pages"], 3) + require.Equal(t, "t1/c1", cat.Pages[0].Title) + } |