Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorfeistel <6742251-feistel@users.noreply.gitlab.com>2022-06-22 22:32:02 +0300
committerfeistel <6742251-feistel@users.noreply.gitlab.com>2022-06-22 22:32:02 +0300
commit3e8a817dd5aa36457fb611967d951fe1545e9593 (patch)
tree619c5cf672a4030f17f0fa9d155e0797268455d8 /test
parent3fb57b7a2989b50ca4c9543ec86c1f5751cf1a41 (diff)
Check for errors in acme tests before passing the body
Diffstat (limited to 'test')
-rw-r--r--test/acceptance/acme_test.go6
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)