diff options
author | Jaime Martinez <jmartinez@gitlab.com> | 2022-04-05 04:30:42 +0300 |
---|---|---|
committer | Jaime Martinez <jmartinez@gitlab.com> | 2022-04-05 04:30:42 +0300 |
commit | 5321248fd47127cc71f719aaafefc364379a9c56 (patch) | |
tree | 24b222b5f2639457ab2c74199c916dd72ca76694 /test | |
parent | 8b79c056065c776fef0da08bf4a3de6e4da99aad (diff) | |
parent | 524b1783131079915e1fa22b7c8523e5aa4e728b (diff) |
Merge branch 'refactor/specialized-require' into 'master'
test: replace require.Equal with specialized assertions
See merge request gitlab-org/gitlab-pages!685
Diffstat (limited to 'test')
-rw-r--r-- | test/acceptance/auth_test.go | 4 | ||||
-rw-r--r-- | test/acceptance/serving_test.go | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/test/acceptance/auth_test.go b/test/acceptance/auth_test.go index dbc7b900..022afcbd 100644 --- a/test/acceptance/auth_test.go +++ b/test/acceptance/auth_test.go @@ -38,7 +38,7 @@ func TestWhenAuthIsEnabledPrivateWillRedirectToAuthorize(t *testing.T) { testhelpers.Close(t, rsp.Body) require.Equal(t, http.StatusFound, rsp.StatusCode) - require.Equal(t, 1, len(rsp.Header["Location"])) + require.Len(t, rsp.Header["Location"], 1) url, err := url.Parse(rsp.Header.Get("Location")) require.NoError(t, err) rsp, err = GetRedirectPage(t, httpsListener, url.Host, url.Path+"?"+url.RawQuery) @@ -46,7 +46,7 @@ func TestWhenAuthIsEnabledPrivateWillRedirectToAuthorize(t *testing.T) { testhelpers.Close(t, rsp.Body) require.Equal(t, http.StatusFound, rsp.StatusCode) - require.Equal(t, 1, len(rsp.Header["Location"])) + require.Len(t, rsp.Header["Location"], 1) url, err = url.Parse(rsp.Header.Get("Location")) require.NoError(t, err) diff --git a/test/acceptance/serving_test.go b/test/acceptance/serving_test.go index bab69357..1808b5e7 100644 --- a/test/acceptance/serving_test.go +++ b/test/acceptance/serving_test.go @@ -279,7 +279,7 @@ func TestHttpToHttpsRedirectEnabled(t *testing.T) { require.NoError(t, err) testhelpers.Close(t, rsp.Body) require.Equal(t, http.StatusTemporaryRedirect, rsp.StatusCode) - require.Equal(t, 1, len(rsp.Header["Location"])) + require.Len(t, rsp.Header["Location"], 1) require.Equal(t, "https://group.gitlab-example.com/project/", rsp.Header.Get("Location")) rsp, err = GetPageFromListener(t, httpsListener, "group.gitlab-example.com", "project/") @@ -455,7 +455,7 @@ func TestQueryStringPersistedInSlashRewrite(t *testing.T) { testhelpers.Close(t, rsp.Body) require.Equal(t, http.StatusFound, rsp.StatusCode) - require.Equal(t, 1, len(rsp.Header["Location"])) + require.Len(t, rsp.Header["Location"], 1) require.Equal(t, "//group.gitlab-example.com/project/?q=test", rsp.Header.Get("Location")) rsp, err = GetPageFromListener(t, httpsListener, "group.gitlab-example.com", "project/?q=test") |