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

Add some APIs on a JIRA group

This commit is contained in:
b4b4r07
2017-11-28 11:56:49 +09:00
parent 9f1498acb6
commit fbd056e79a
3 changed files with 106 additions and 0 deletions

View File

@ -55,3 +55,21 @@ func TestUserService_Create(t *testing.T) {
t.Error("Expected user. User is nil")
}
}
func TestUserService_GetGroups(t *testing.T) {
setup()
defer teardown()
testMux.HandleFunc("/rest/api/2/user/groups", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "GET")
testRequestURL(t, r, "/rest/api/2/user/groups?username=fred")
w.WriteHeader(http.StatusCreated)
fmt.Fprint(w, `[{"name":"jira-software-users","self":"http://www.example.com/jira/rest/api/2/user?username=fred"}]`)
})
if groups, _, err := testClient.User.GetGroups("fred"); err != nil {
t.Errorf("Error given: %s", err)
} else if groups == nil {
t.Error("Expected user groups. []UserGroup is nil")
}
}