diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-03-23 20:05:10 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-03-27 15:43:56 +0200 |
commit | d851d6b98fefbe7de91c8c58b883cca4da17eea9 (patch) | |
tree | 5171cf499aef5d69ef00ef3b4bcdca777363060b /hugolib/site_output_test.go | |
parent | 8bcc08e3b0ddd5762101bb2f061e0be04ecd8d57 (diff) |
Add custom protocol support in Permalink
Diffstat (limited to 'hugolib/site_output_test.go')
-rw-r--r-- | hugolib/site_output_test.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/hugolib/site_output_test.go b/hugolib/site_output_test.go index 6694a9bfd..006f3bad0 100644 --- a/hugolib/site_output_test.go +++ b/hugolib/site_output_test.go @@ -52,7 +52,7 @@ func TestDefaultOutputFormats(t *testing.T) { } func TestSiteWithPageOutputs(t *testing.T) { - for _, outputs := range [][]string{{"html", "json"}, {"json"}} { + for _, outputs := range [][]string{{"html", "json", "calendar"}, {"json"}} { t.Run(fmt.Sprintf("%v", outputs), func(t *testing.T) { doTestSiteWithPageOutputs(t, outputs) }) @@ -146,4 +146,12 @@ Output/Rel: {{ .Name -}}/{{ .Rel }}| require.Equal(t, "/blog/index.json", json.RelPermalink()) require.Equal(t, "http://example.com/blog/index.json", json.Permalink()) + if helpers.InStringArray(outputs, "cal") { + // TODO(bep) output have do some protocil handling for the default too if set. + cal := of.Get("calendar") + require.NotNil(t, cal) + require.Equal(t, "/blog/index.ics", cal.RelPermalink()) + require.Equal(t, "webcal://example.com/blog/index.ics", cal.Permalink()) + } + } |