diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2016-11-02 21:34:19 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2016-11-22 09:57:03 +0100 |
commit | 3ff25b37a3d327646255572072d6686d48a142e9 (patch) | |
tree | dea615738376a6a0ec15a32b8bb1102ed5d3a5c7 /hugolib/node_as_page_test.go | |
parent | 75c38071d8c61e2e1a56ae1949766b4144b68305 (diff) |
node to page: Handle RSS
Updates #2297
Diffstat (limited to 'hugolib/node_as_page_test.go')
-rw-r--r-- | hugolib/node_as_page_test.go | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/hugolib/node_as_page_test.go b/hugolib/node_as_page_test.go index 9c8506503..8276f2d23 100644 --- a/hugolib/node_as_page_test.go +++ b/hugolib/node_as_page_test.go @@ -31,8 +31,8 @@ import ( */ func TestNodesAsPage(t *testing.T) { - //jww.SetStdoutThreshold(jww.LevelDebug) - jww.SetStdoutThreshold(jww.LevelFatal) + jww.SetStdoutThreshold(jww.LevelDebug) + //jww.SetStdoutThreshold(jww.LevelFatal) nodePageFeatureFlag = true defer toggleNodePageFeatureFlag() @@ -105,6 +105,8 @@ Content Page %02d } viper.Set("paginate", 1) + viper.Set("title", "Hugo Rocks") + viper.Set("rssURI", "customrss.xml") s := newSiteDefaultLang() @@ -172,11 +174,18 @@ Content Page %02d // There are no pages to paginate over in the taxonomy terms. + // RSS + assertFileContent(t, filepath.Join("public", "customrss.xml"), false, "Recent content in Home Sweet Home! on Hugo Rocks", "<rss") + assertFileContent(t, filepath.Join("public", "sect1", "customrss.xml"), false, "Recent content in Section1 on Hugo Rocks", "<rss") + assertFileContent(t, filepath.Join("public", "sect2", "customrss.xml"), false, "Recent content in Section2 on Hugo Rocks", "<rss") + assertFileContent(t, filepath.Join("public", "categories", "hugo", "customrss.xml"), false, "Recent content in Taxonomy Hugo on Hugo Rocks", "<rss") + assertFileContent(t, filepath.Join("public", "categories", "web", "customrss.xml"), false, "Recent content in Taxonomy Web on Hugo Rocks", "<rss") + } func TestNodesWithNoContentFile(t *testing.T) { - //jww.SetStdoutThreshold(jww.LevelDebug) - jww.SetStdoutThreshold(jww.LevelFatal) + jww.SetStdoutThreshold(jww.LevelDebug) + //jww.SetStdoutThreshold(jww.LevelFatal) nodePageFeatureFlag = true defer toggleNodePageFeatureFlag() @@ -203,6 +212,7 @@ Content Page %02d viper.Set("paginate", 1) viper.Set("title", "Hugo Rocks!") + viper.Set("rssURI", "customrss.xml") s := newSiteDefaultLang() @@ -234,6 +244,13 @@ Content Page %02d assertFileContent(t, filepath.Join("public", "sect2", "index.html"), false, "Section Title: Sect2s") + // RSS + assertFileContent(t, filepath.Join("public", "customrss.xml"), false, "Recent content in Hugo Rocks! on Hugo Rocks!", "<rss") + assertFileContent(t, filepath.Join("public", "sect1", "customrss.xml"), false, "Recent content in Sect1s on Hugo Rocks!", "<rss") + assertFileContent(t, filepath.Join("public", "sect2", "customrss.xml"), false, "Recent content in Sect2s on Hugo Rocks!", "<rss") + assertFileContent(t, filepath.Join("public", "categories", "hugo", "customrss.xml"), false, "Recent content in Hugo on Hugo Rocks!", "<rss") + assertFileContent(t, filepath.Join("public", "categories", "web", "customrss.xml"), false, "Recent content in Web on Hugo Rocks!", "<rss") + } func writeLayoutsForNodeAsPageTests(t *testing.T) { |