test: use the add token auth method for token
This commit is contained in:
@@ -89,9 +89,7 @@ func TestAPIListUserProjects(t *testing.T) {
|
|||||||
token := getUserToken(t, "user2", auth_model.AccessTokenScopeReadUser, auth_model.AccessTokenScopeReadIssue)
|
token := getUserToken(t, "user2", auth_model.AccessTokenScopeReadUser, auth_model.AccessTokenScopeReadIssue)
|
||||||
link, _ := url.Parse(fmt.Sprintf("/api/v1/user/projects"))
|
link, _ := url.Parse(fmt.Sprintf("/api/v1/user/projects"))
|
||||||
|
|
||||||
link.RawQuery = url.Values{"token": {token}}.Encode()
|
req := NewRequest(t, "GET", link.String()).AddTokenAuth(token)
|
||||||
|
|
||||||
req := NewRequest(t, "GET", link.String())
|
|
||||||
var apiProjects []*api.Project
|
var apiProjects []*api.Project
|
||||||
|
|
||||||
resp := MakeRequest(t, req, http.StatusOK)
|
resp := MakeRequest(t, req, http.StatusOK)
|
||||||
|
|||||||
Reference in New Issue
Block a user