summaryrefslogtreecommitdiffstats
path: root/hugolib/rss_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'hugolib/rss_test.go')
-rw-r--r--hugolib/rss_test.go25
1 files changed, 23 insertions, 2 deletions
diff --git a/hugolib/rss_test.go b/hugolib/rss_test.go
index db26c7d2d..683a737c5 100644
--- a/hugolib/rss_test.go
+++ b/hugolib/rss_test.go
@@ -1,4 +1,4 @@
-// Copyright 2016 The Hugo Authors. All rights reserved.
+// Copyright 2019 The Hugo Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -47,7 +47,7 @@ func TestRSSOutput(t *testing.T) {
// Section RSS
th.assertFileContent(filepath.Join("public", "sect", rssURI), "<?xml", "rss version", "Sects on RSSTest")
// Taxonomy RSS
- th.assertFileContent(filepath.Join("public", "categories", "hugo", rssURI), "<?xml", "rss version", "Hugo on RSSTest")
+ th.assertFileContent(filepath.Join("public", "categories", "hugo", rssURI), "<?xml", "rss version", "hugo on RSSTest")
// RSS Item Limit
content := readDestination(t, fs, filepath.Join("public", rssURI))
@@ -74,3 +74,24 @@ func TestRSSKind(t *testing.T) {
b.AssertFileContent("public/index.xml", "RSS Kind: home")
}
+
+func TestRSSCanonifyURLs(t *testing.T) {
+ t.Parallel()
+
+ b := newTestSitesBuilder(t)
+ b.WithSimpleConfigFile().WithTemplatesAdded("index.rss.xml", `<rss>{{ range .Pages }}<item>{{ .Content | html }}</item>{{ end }}</rss>`)
+ b.WithContent("page.md", `---
+Title: My Page
+---
+
+Figure:
+
+{{< figure src="/images/sunset.jpg" title="Sunset" >}}
+
+
+
+`)
+ b.Build(BuildCfg{})
+
+ b.AssertFileContent("public/index.xml", "img src=&#34;http://example.com/images/sunset.jpg")
+}