diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-03-22 00:25:55 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-03-27 15:43:56 +0200 |
commit | 1b2be5e878c0bd8c68731389e46bf1c6d3664635 (patch) | |
tree | 1174452aab6221fc940db4cd31821275a00c162f /hugolib/site_output_test.go | |
parent | baa29f6534fcd324dbade7dd6c32c90547e3fa4f (diff) |
hugolib: Add OutputFormats with permalinks to Page
Diffstat (limited to 'hugolib/site_output_test.go')
-rw-r--r-- | hugolib/site_output_test.go | 13 |
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()) + } |