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
diff options
context:
space:
mode:
authorTuomo Ala-Vannesluoma <tuomoav@gmail.com>2018-07-02 18:25:48 +0300
committerTuomo Ala-Vannesluoma <tuomoav@gmail.com>2018-07-02 18:25:48 +0300
commit5021d635a0a37f296467fa78122273ad5f1f8128 (patch)
tree40f746733e8b36ea1f8b648500cd36504f2bdcba /acceptance_test.go
parent415f4224b04c631588fba386687e69b47cae9be4 (diff)
Remove duplicate test
Diffstat (limited to 'acceptance_test.go')
-rw-r--r--acceptance_test.go61
1 files changed, 0 insertions, 61 deletions
diff --git a/acceptance_test.go b/acceptance_test.go
index c095b4ba..4a9c2f22 100644
--- a/acceptance_test.go
+++ b/acceptance_test.go
@@ -804,64 +804,3 @@ func TestAccessControl(t *testing.T) {
})
}
}
-
-func TestWhenLoginCallbackWithCorrectStateWithEndpointButTokenIsInvalid(t *testing.T) {
- skipUnlessEnabled(t)
-
- testServer := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- switch r.URL.Path {
- case "/oauth/token":
- assert.Equal(t, "POST", r.Method)
- w.WriteHeader(http.StatusOK)
- fmt.Fprint(w, "{\"access_token\":\"abc\"}")
- case "/api/v4/projects/1000":
- assert.Equal(t, "Bearer abc", r.Header.Get("Authorization"))
- w.WriteHeader(http.StatusUnauthorized)
- fmt.Fprint(w, "{\"error\":\"invalid_token\"}")
- default:
- t.Logf("Unexpected r.URL.RawPath: %q", r.URL.Path)
- w.Header().Set("Content-Type", "text/html; charset=utf-8")
- w.WriteHeader(http.StatusNotFound)
- }
- }))
-
- testServer.Start()
- defer testServer.Close()
-
- teardown := RunPagesProcessWithAuthServer(t, *pagesBinary, listeners, "", testServer.URL)
- defer teardown()
-
- rsp, err := GetRedirectPage(t, httpsListener, "group.gitlab-example.com", "private.project/")
-
- require.NoError(t, err)
- defer rsp.Body.Close()
-
- cookie := rsp.Header.Get("Set-Cookie")
-
- url, err := url.Parse(rsp.Header.Get("Location"))
- require.NoError(t, err)
-
- // Go to auth page with correct state will cause fetching the token
- authrsp, err := GetRedirectPageWithCookie(t, httpsListener, "gitlab-example.com", "/auth?code=1&state="+
- url.Query().Get("state"), cookie)
-
- require.NoError(t, err)
- defer authrsp.Body.Close()
-
- // server returns the ticket, user will be redirected to the project page
- assert.Equal(t, http.StatusFound, authrsp.StatusCode)
- cookie = authrsp.Header.Get("Set-Cookie")
- rsp, err = GetRedirectPageWithCookie(t, httpsListener, "group.gitlab-example.com", "private.project/", cookie)
-
- require.NoError(t, err)
- defer rsp.Body.Close()
-
- // server returns token is invalid and removes token from cookie and redirects user back to be redirected for new token
- assert.Equal(t, http.StatusFound, rsp.StatusCode)
- url, err = url.Parse(rsp.Header.Get("Location"))
- require.NoError(t, err)
-
- assert.Equal(t, "https", url.Scheme)
- assert.Equal(t, "group.gitlab-example.com", url.Host)
- assert.Equal(t, "/private.project/", url.Path)
-}