1
0
mirror of https://github.com/interviewstreet/go-jira.git synced 2025-06-23 00:07:40 +02:00

Add delete method for user

This commit is contained in:
Vladimir N. Indik
2018-07-11 10:53:16 +02:00
committed by Andy Grunwald
parent 13606a505f
commit 8201aaa4d4
2 changed files with 38 additions and 0 deletions

View File

@ -56,6 +56,26 @@ func TestUserService_Create(t *testing.T) {
}
}
func TestUserService_Delete(t *testing.T) {
setup()
defer teardown()
testMux.HandleFunc("/rest/api/2/user", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "DELETE")
testRequestURL(t, r, "/rest/api/2/user?username=fred")
w.WriteHeader(http.StatusNoContent)
})
resp, err := testClient.User.Delete("fred")
if err != nil {
t.Errorf("Error given: %s", err)
}
if resp.StatusCode != http.StatusNoContent {
t.Errorf("Wrong status code: %d. Expected %d", resp.StatusCode, http.StatusNoContent)
}
}
func TestUserService_GetGroups(t *testing.T) {
setup()
defer teardown()