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:
committed by
Andy Grunwald
parent
13606a505f
commit
8201aaa4d4
20
user_test.go
20
user_test.go
@ -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()
|
||||
|
Reference in New Issue
Block a user