diff options
Diffstat (limited to 'hugolib/sitemap_test.go')
-rw-r--r-- | hugolib/sitemap_test.go | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/hugolib/sitemap_test.go b/hugolib/sitemap_test.go index c508fbc31..58408ce47 100644 --- a/hugolib/sitemap_test.go +++ b/hugolib/sitemap_test.go @@ -37,37 +37,20 @@ const SITEMAP_TEMPLATE = `<urlset xmlns="http://www.sitemaps.org/schemas/sitemap </urlset>` func TestSitemapOutput(t *testing.T) { - viper.Reset() - defer viper.Reset() - - hugofs.InitMemFs() + testCommonResetState() viper.Set("baseurl", "http://auth/bub/") s := &Site{ - Source: &source.InMemorySource{ByteSource: weightedSources}, - Lang: newDefaultLanguage(), - } - - s.initializeSiteInfo() - - s.prepTemplates("sitemap.xml", SITEMAP_TEMPLATE) - - createPagesAndMeta(t, s) - - if err := s.renderHomePage(); err != nil { - t.Fatalf("Unable to RenderHomePage: %s", err) - } - - if err := s.renderSitemap(); err != nil { - t.Fatalf("Unable to RenderSitemap: %s", err) + Source: &source.InMemorySource{ByteSource: weightedSources}, + Language: newDefaultLanguage(), } - if err := s.renderRobotsTXT(); err != nil { - t.Fatalf("Unable to RenderRobotsTXT :%s", err) + if err := buildAndRenderSite(s, "sitemap.xml", SITEMAP_TEMPLATE); err != nil { + t.Fatalf("Failed to build site: %s", err) } - sitemapFile, err := hugofs.Destination().Open("sitemap.xml") + sitemapFile, err := hugofs.Destination().Open("public/sitemap.xml") if err != nil { t.Fatalf("Unable to locate: sitemap.xml") |