summaryrefslogtreecommitdiffstats
path: root/tests/integration/api_admin_org_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'tests/integration/api_admin_org_test.go')
-rw-r--r--tests/integration/api_admin_org_test.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/integration/api_admin_org_test.go b/tests/integration/api_admin_org_test.go
index 0bf4b1f7cb..a29d0ba1d7 100644
--- a/tests/integration/api_admin_org_test.go
+++ b/tests/integration/api_admin_org_test.go
@@ -31,7 +31,8 @@ func TestAPIAdminOrgCreate(t *testing.T) {
Location: "Shanghai",
Visibility: "private",
}
- req := NewRequestWithJSON(t, "POST", "/api/v1/admin/users/user2/orgs?token="+token, &org)
+ req := NewRequestWithJSON(t, "POST", "/api/v1/admin/users/user2/orgs", &org).
+ AddTokenAuth(token)
resp := MakeRequest(t, req, http.StatusCreated)
var apiOrg api.Organization
@@ -65,7 +66,8 @@ func TestAPIAdminOrgCreateBadVisibility(t *testing.T) {
Location: "Shanghai",
Visibility: "notvalid",
}
- req := NewRequestWithJSON(t, "POST", "/api/v1/admin/users/user2/orgs?token="+token, &org)
+ req := NewRequestWithJSON(t, "POST", "/api/v1/admin/users/user2/orgs", &org).
+ AddTokenAuth(token)
MakeRequest(t, req, http.StatusUnprocessableEntity)
})
}
@@ -83,6 +85,7 @@ func TestAPIAdminOrgCreateNotAdmin(t *testing.T) {
Location: "Shanghai",
Visibility: "public",
}
- req := NewRequestWithJSON(t, "POST", "/api/v1/admin/users/user2/orgs?token="+token, &org)
+ req := NewRequestWithJSON(t, "POST", "/api/v1/admin/users/user2/orgs", &org).
+ AddTokenAuth(token)
MakeRequest(t, req, http.StatusForbidden)
}