diff options
author | yigithankardas <root> | 2022-02-16 16:34:05 +0300 |
---|---|---|
committer | yigithankardas <root> | 2022-02-16 16:34:05 +0300 |
commit | d8f645df7f1fb711698ecc31f71b577b3f8dc617 (patch) | |
tree | ff4b8dcc1bf5933e91caf790b285f056ee93a7e4 /test/acceptance/artifacts_test.go | |
parent | d4a251ae1bb492fee8af0d3d3619bdd3f5bfc1c0 (diff) |
reset: go back to initial commit.
Diffstat (limited to 'test/acceptance/artifacts_test.go')
-rw-r--r-- | test/acceptance/artifacts_test.go | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/test/acceptance/artifacts_test.go b/test/acceptance/artifacts_test.go index f087581c..ba38146b 100644 --- a/test/acceptance/artifacts_test.go +++ b/test/acceptance/artifacts_test.go @@ -11,6 +11,8 @@ import ( "time" "github.com/stretchr/testify/require" + + "gitlab.com/gitlab-org/gitlab-pages/internal/testhelpers" ) func TestArtifactProxyRequest(t *testing.T) { @@ -133,7 +135,7 @@ func TestArtifactProxyRequest(t *testing.T) { resp, err := GetPageFromListener(t, httpListener, tt.host, tt.path) require.NoError(t, err) - defer resp.Body.Close() + testhelpers.Close(t, resp.Body) require.Equal(t, tt.status, resp.StatusCode) require.Equal(t, tt.contentType, resp.Header.Get("Content-Type")) @@ -229,7 +231,7 @@ func TestPrivateArtifactProxyRequest(t *testing.T) { resp, err := GetRedirectPage(t, httpsListener, tt.host, tt.path) require.NoError(t, err) - defer resp.Body.Close() + testhelpers.Close(t, resp.Body) require.Equal(t, http.StatusFound, resp.StatusCode) @@ -245,7 +247,7 @@ func TestPrivateArtifactProxyRequest(t *testing.T) { resp, err = GetRedirectPage(t, httpsListener, url.Host, url.Path+"?"+url.RawQuery) require.NoError(t, err) - defer resp.Body.Close() + testhelpers.Close(t, resp.Body) require.Equal(t, http.StatusFound, resp.StatusCode) pagesDomainCookie := resp.Header.Get("Set-Cookie") @@ -255,7 +257,7 @@ func TestPrivateArtifactProxyRequest(t *testing.T) { state, pagesDomainCookie) require.NoError(t, err) - defer authrsp.Body.Close() + testhelpers.Close(t, authrsp.Body) // Will redirect auth callback to correct host url, err = url.Parse(authrsp.Header.Get("Location")) @@ -266,7 +268,7 @@ func TestPrivateArtifactProxyRequest(t *testing.T) { // Request auth callback in project domain authrsp, err = GetRedirectPageWithCookie(t, httpsListener, url.Host, url.Path+"?"+url.RawQuery, cookie) require.NoError(t, err) - defer authrsp.Body.Close() + testhelpers.Close(t, authrsp.Body) // server returns the ticket, user will be redirected to the project page require.Equal(t, http.StatusFound, authrsp.StatusCode) @@ -276,7 +278,7 @@ func TestPrivateArtifactProxyRequest(t *testing.T) { require.Equal(t, tt.status, resp.StatusCode) require.NoError(t, err) - defer resp.Body.Close() + testhelpers.Close(t, resp.Body) }) } } |