small fixes

This commit is contained in:
Niko Abeler 2022-07-24 16:30:49 +02:00
parent d961fb65e8
commit 50bb7ff078
2 changed files with 3 additions and 3 deletions

View File

@ -65,7 +65,7 @@ func RenderIndexPage(user User) (string, error) {
}
var html bytes.Buffer
t, err := template.New("post").Parse(baseTemplate)
t, err := template.New("index").Parse(baseTemplate)
t.Execute(&html, data)

View File

@ -43,9 +43,9 @@ func TestCanRenderIndexPage(t *testing.T) {
user.CreateNewPost("testpost2")
result, _ := kiss.RenderIndexPage(user)
if !strings.Contains(result, "testpost1") {
t.Error("Post title not rendered as h1. Got: " + result)
t.Error("Post title not rendered. Got: " + result)
}
if !strings.Contains(result, "testpost2") {
t.Error("Post title not rendered as h1. Got: " + result)
t.Error("Post title not rendered. Got: " + result)
}
}