summaryrefslogtreecommitdiffstats
path: root/hugolib/site_output_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-03-22 00:25:55 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-03-27 15:43:56 +0200
commit1b2be5e878c0bd8c68731389e46bf1c6d3664635 (patch)
tree1174452aab6221fc940db4cd31821275a00c162f /hugolib/site_output_test.go
parentbaa29f6534fcd324dbade7dd6c32c90547e3fa4f (diff)
hugolib: Add OutputFormats with permalinks to Page
Diffstat (limited to 'hugolib/site_output_test.go')
-rw-r--r--hugolib/site_output_test.go13
1 files changed, 11 insertions, 2 deletions
diff --git a/hugolib/site_output_test.go b/hugolib/site_output_test.go
index 3e5df6a63..12746e88b 100644
--- a/hugolib/site_output_test.go
+++ b/hugolib/site_output_test.go
@@ -65,7 +65,7 @@ category = "categories"
pageTemplate := `---
title: "%s"
-outputs: ["json"]
+outputs: ["html", "json"]
---
# Doc
`
@@ -88,10 +88,19 @@ outputs: ["json"]
require.NotNil(t, home)
- require.Len(t, home.outputFormats, 1)
+ require.Len(t, home.outputFormats, 2)
// TODO(bep) output assert template/text
th.assertFileContent("public/index.json", "List JSON")
+ of := home.OutputFormats()
+ require.Len(t, of, 2)
+ require.Nil(t, of.Get("Hugo"))
+ require.NotNil(t, of.Get("json"))
+ json := of.Get("JSON")
+ require.NotNil(t, json)
+ require.Equal(t, "/blog/index.json", json.RelPermalink())
+ require.Equal(t, "http://example.com/blog/index.json", json.Permalink())
+
}