aboutsummaryrefslogtreecommitdiffhomepage
path: root/hugolib/site_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2017-04-09 10:33:04 +0200
committerBjørn Erik Pedersen <[email protected]>2017-06-08 11:21:34 +0200
commitb39689393ccb8434d9a57658a64b77568c718e99 (patch)
tree944d679ac8e908444eb00d0d405ec3c131f31bab /hugolib/site_test.go
parentbef5048580b38b0c29edef4eb8c67915033120e9 (diff)
downloadhugo-b39689393ccb8434d9a57658a64b77568c718e99.tar.gz
hugo-b39689393ccb8434d9a57658a64b77568c718e99.zip
hugolib: Enable nested sections
Fixes #465
Diffstat (limited to 'hugolib/site_test.go')
-rw-r--r--hugolib/site_test.go10
1 files changed, 3 insertions, 7 deletions
diff --git a/hugolib/site_test.go b/hugolib/site_test.go
index 92aea4d4d..2ef7b56d9 100644
--- a/hugolib/site_test.go
+++ b/hugolib/site_test.go
@@ -438,7 +438,7 @@ func doTestSectionNaming(t *testing.T, canonify, uglify, pluralize bool) {
mainSections, err := s.Info.Param("mainSections")
require.NoError(t, err)
- require.Equal(t, mainSections, []string{"sect"})
+ require.Equal(t, []string{"sect"}, mainSections)
th := testHelper{s.Cfg, s.Fs, t}
tests := []struct {
@@ -635,12 +635,8 @@ func TestOrderedPages(t *testing.T) {
s := buildSingleSite(t, deps.DepsCfg{Fs: fs, Cfg: cfg}, BuildCfg{SkipRender: true})
- if s.Sections["sect"][0].Weight != 2 || s.Sections["sect"][3].Weight != 6 {
- t.Errorf("Pages in unexpected order. First should be '%d', got '%d'", 2, s.Sections["sect"][0].Weight)
- }
-
- if s.Sections["sect"][1].Page.Title != "Three" || s.Sections["sect"][2].Page.Title != "Four" {
- t.Errorf("Pages in unexpected order. Second should be '%s', got '%s'", "Three", s.Sections["sect"][1].Page.Title)
+ if s.getPage(KindSection, "sect").Pages[1].Title != "Three" || s.getPage(KindSection, "sect").Pages[2].Title != "Four" {
+ t.Error("Pages in unexpected order.")
}
bydate := s.RegularPages.ByDate()