Added controller testing.

This commit is contained in:
mikestefanello 2021-12-05 20:22:45 -05:00
parent 7f93fa7f6c
commit 5e384c8a4e
7 changed files with 105 additions and 16 deletions

17
controllers/about_test.go Normal file
View file

@ -0,0 +1,17 @@
package controllers
import (
"net/http"
"testing"
"github.com/stretchr/testify/assert"
)
func TestAbout_Get(t *testing.T) {
resp := GetRequest(t, "about")
assert.Equal(t, http.StatusOK, resp.StatusCode)
doc := GetGoqueryDoc(t, resp)
h1 := doc.Find("h1.title")
assert.Len(t, h1.Nodes, 1)
assert.Equal(t, "About", h1.Text())
}