Easier get request controller testing.

This commit is contained in:
mikestefanello 2021-12-06 07:42:20 -05:00
parent e499257686
commit a5d8d2ea35
2 changed files with 28 additions and 13 deletions

View file

@ -8,9 +8,10 @@ import (
)
func TestAbout_Get(t *testing.T) {
resp := GetRequest(t, "about")
assert.Equal(t, http.StatusOK, resp.StatusCode)
doc := GetGoqueryDoc(t, resp)
doc := getRequest(t, "about").
assertStatusCode(http.StatusOK).
toDoc()
h1 := doc.Find("h1.title")
assert.Len(t, h1.Nodes, 1)
assert.Equal(t, "About", h1.Text())