2013-08-13 13:46:05 -04:00
|
|
|
package hugolib
|
|
|
|
|
|
|
|
import (
|
2014-01-18 21:26:34 -05:00
|
|
|
"strings"
|
|
|
|
"testing"
|
2013-08-13 13:46:05 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestSitePossibleIndexes(t *testing.T) {
|
2014-01-18 21:26:34 -05:00
|
|
|
site := new(Site)
|
|
|
|
page, _ := ReadFrom(strings.NewReader(PAGE_YAML_WITH_INDEXES_A), "path/to/page")
|
|
|
|
site.Pages = append(site.Pages, page)
|
|
|
|
indexes := site.possibleIndexes()
|
|
|
|
if !compareStringSlice(indexes, []string{"tags", "categories"}) {
|
|
|
|
if !compareStringSlice(indexes, []string{"categories", "tags"}) {
|
|
|
|
t.Fatalf("possible indexes do not match [tags categories]. Got: %s", indexes)
|
|
|
|
}
|
|
|
|
}
|
2013-08-13 13:46:05 -04:00
|
|
|
}
|