add integration test for custom domain

This commit is contained in:
6543 2022-06-13 13:47:11 +02:00
parent d0d5189753
commit 5a5a7274c2

View file

@ -49,6 +49,16 @@ func TestGetContent(t *testing.T) {
assert.True(t, getSize(resp.Body) > 1000)
}
func TestCustomDomain(t *testing.T) {
resp, err := getTestHTTPSClient().Get("https://mock-pages.codeberg-test.org:4430/README.md")
assert.NoError(t, err)
if !assert.EqualValues(t, http.StatusOK, resp.StatusCode) {
t.FailNow()
}
assert.EqualValues(t, "text/html; charset=utf-8", resp.Header["Content-Type"][0])
assert.EqualValues(t, 106, getSize(resp.Body))
}
func TestGetNotFound(t *testing.T) {
log.Printf("== TestGetNotFound ==\n")
// test custom not found pages