diff options
author | feistel <6742251-feistel@users.noreply.gitlab.com> | 2022-06-22 22:32:02 +0300 |
---|---|---|
committer | feistel <6742251-feistel@users.noreply.gitlab.com> | 2022-06-22 22:32:02 +0300 |
commit | 3e8a817dd5aa36457fb611967d951fe1545e9593 (patch) | |
tree | 619c5cf672a4030f17f0fa9d155e0797268455d8 | |
parent | 3fb57b7a2989b50ca4c9543ec86c1f5751cf1a41 (diff) |
Check for errors in acme tests before passing the body
-rw-r--r-- | test/acceptance/acme_test.go | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/test/acceptance/acme_test.go b/test/acceptance/acme_test.go index d743a4e1..40d98a21 100644 --- a/test/acceptance/acme_test.go +++ b/test/acceptance/acme_test.go @@ -7,8 +7,6 @@ import ( "testing" "github.com/stretchr/testify/require" - - "gitlab.com/gitlab-org/gitlab-pages/internal/testhelpers" ) const ( @@ -43,10 +41,10 @@ func TestAcmeChallengesWhenItIsNotConfigured(t *testing.T) { rsp, err := GetRedirectPage(t, httpListener, "withacmechallenge.domain.com", test.token) - testhelpers.Close(t, rsp.Body) require.NoError(t, err) require.Equal(t, test.expectedStatus, rsp.StatusCode) body, err := io.ReadAll(rsp.Body) + require.NoError(t, rsp.Body.Close()) require.NoError(t, err) require.Contains(t, string(body), test.expectedContent) @@ -84,10 +82,10 @@ func TestAcmeChallengesWhenItIsConfigured(t *testing.T) { rsp, err := GetRedirectPage(t, httpListener, "withacmechallenge.domain.com", test.token) - testhelpers.Close(t, rsp.Body) require.NoError(t, err) require.Equal(t, test.expectedStatus, rsp.StatusCode) body, err := io.ReadAll(rsp.Body) + require.NoError(t, rsp.Body.Close()) require.NoError(t, err) require.Contains(t, string(body), test.expectedContent) |