mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
Make RSS output test more realistic
By setting a non-default RSS uri config value.
This commit is contained in:
parent
fd08e16ec8
commit
beb4ab162d
1 changed files with 5 additions and 3 deletions
|
@ -33,8 +33,10 @@ const RSS_TEMPLATE = `<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom
|
|||
</rss>`
|
||||
|
||||
func TestRSSOutput(t *testing.T) {
|
||||
rssUri := "customrss.xml"
|
||||
viper.Set("baseurl", "http://auth/bub/")
|
||||
viper.Set("RSSUri", "index.xml")
|
||||
viper.Set("RSSUri", rssUri)
|
||||
defer viper.Set("RSSUri", "index.xml")
|
||||
|
||||
hugofs.DestinationFS = new(afero.MemMapFs)
|
||||
s := &Site{
|
||||
|
@ -57,10 +59,10 @@ func TestRSSOutput(t *testing.T) {
|
|||
t.Fatalf("Unable to RenderHomePage: %s", err)
|
||||
}
|
||||
|
||||
file, err := hugofs.DestinationFS.Open("index.xml")
|
||||
file, err := hugofs.DestinationFS.Open(rssUri)
|
||||
|
||||
if err != nil {
|
||||
t.Fatalf("Unable to locate: %s", "index.xml")
|
||||
t.Fatalf("Unable to locate: %s", rssUri)
|
||||
}
|
||||
|
||||
rss := helpers.ReaderToBytes(file)
|
||||
|
|
Loading…
Reference in a new issue