diff options
Diffstat (limited to 'test/acceptance/encodings_test.go')
-rw-r--r-- | test/acceptance/encodings_test.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/acceptance/encodings_test.go b/test/acceptance/encodings_test.go index 18f2c492..c3532bd9 100644 --- a/test/acceptance/encodings_test.go +++ b/test/acceptance/encodings_test.go @@ -6,6 +6,8 @@ import ( "testing" "github.com/stretchr/testify/require" + + "gitlab.com/gitlab-org/gitlab-pages/internal/testhelpers" ) func TestMIMETypes(t *testing.T) { @@ -27,7 +29,7 @@ func TestMIMETypes(t *testing.T) { t.Run(name, func(t *testing.T) { rsp, err := GetPageFromListener(t, httpListener, "group.gitlab-example.com", "project/"+tt.file) require.NoError(t, err) - defer rsp.Body.Close() + testhelpers.Close(t, rsp.Body) require.Equal(t, http.StatusOK, rsp.StatusCode) mt, _, err := mime.ParseMediaType(rsp.Header.Get("Content-Type")) @@ -69,7 +71,7 @@ func TestCompressedEncoding(t *testing.T) { } rsp, err := GetPageFromListenerWithHeaders(t, httpListener, "group.gitlab-example.com", "index.html", header) require.NoError(t, err) - defer rsp.Body.Close() + testhelpers.Close(t, rsp.Body) require.Equal(t, http.StatusOK, rsp.StatusCode) require.Equal(t, tt.encoding, rsp.Header.Get("Content-Encoding")) |