mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-22 21:42:50 +02:00
Spring test cleaning, take 2
This commit is contained in:
@@ -14,30 +14,19 @@
|
||||
package hugolib
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
|
||||
"testing"
|
||||
|
||||
"github.com/gohugoio/hugo/deps"
|
||||
)
|
||||
|
||||
func Test404(t *testing.T) {
|
||||
t.Parallel()
|
||||
var (
|
||||
cfg, fs = newTestCfg()
|
||||
th = testHelper{cfg, fs, t}
|
||||
)
|
||||
|
||||
cfg.Set("baseURL", "http://auth/bub/")
|
||||
|
||||
writeSource(t, fs, filepath.Join("layouts", "404.html"), "<html><body>Not Found!</body></html>")
|
||||
writeSource(t, fs, filepath.Join("content", "page.md"), "A page")
|
||||
|
||||
buildSingleSite(t, deps.DepsCfg{Fs: fs, Cfg: cfg}, BuildCfg{})
|
||||
b := newTestSitesBuilder(t)
|
||||
b.WithSimpleConfigFile().WithTemplatesAdded("404.html", "<html><body>Not Found!</body></html>")
|
||||
b.Build(BuildCfg{})
|
||||
|
||||
// Note: We currently have only 1 404 page. One might think that we should have
|
||||
// multiple, to follow the Custom Output scheme, but I don't see how that wold work
|
||||
// multiple, to follow the Custom Output scheme, but I don't see how that would work
|
||||
// right now.
|
||||
th.assertFileContent("public/404.html", "Not Found")
|
||||
b.AssertFileContent("public/404.html", "Not Found")
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user