Add one more menu test

See #1774
This commit is contained in:
Bjørn Erik Pedersen 2016-01-14 17:30:05 +01:00
parent ab70e6f52f
commit 78f9bf2444

View file

@ -44,6 +44,10 @@ const (
name = "ext" name = "ext"
url = "http://gohugo.io" url = "http://gohugo.io"
identifier = "ext" identifier = "ext"
[[menu.main]]
name = "ext2"
url = "http://foo.local/Zoo/foo"
identifier = "ext2"
[[menu.grandparent]] [[menu.grandparent]]
name = "grandparent" name = "grandparent"
url = "/grandparent" url = "/grandparent"
@ -313,6 +317,7 @@ func TestPageMenu(t *testing.T) {
func TestMenuURL(t *testing.T) { func TestMenuURL(t *testing.T) {
viper.Reset() viper.Reset()
defer viper.Reset() defer viper.Reset()
s := setupMenuTests(t, MENU_PAGE_SOURCES) s := setupMenuTests(t, MENU_PAGE_SOURCES)
for i, this := range []struct { for i, this := range []struct {
@ -323,6 +328,7 @@ func TestMenuURL(t *testing.T) {
{findTestMenuEntryByID(s, "hash", "hash"), "/Zoo/resource#anchor"}, {findTestMenuEntryByID(s, "hash", "hash"), "/Zoo/resource#anchor"},
// issue #1774 // issue #1774
{findTestMenuEntryByID(s, "main", "ext"), "http://gohugo.io"}, {findTestMenuEntryByID(s, "main", "ext"), "http://gohugo.io"},
{findTestMenuEntryByID(s, "main", "ext2"), "http://foo.local/Zoo/foo"},
} { } {
if this.me == nil { if this.me == nil {