1
0
mirror of https://github.com/interviewstreet/go-jira.git synced 2025-08-06 22:13:02 +02:00

feat: Add GetAllStatuses

This commit is contained in:
Omar
2019-08-19 05:59:05 +03:00
committed by Wes McNamee
parent 52ab347903
commit afc96b18d1
5 changed files with 597 additions and 12 deletions

35
status_test.go Normal file
View File

@ -0,0 +1,35 @@
package jira
import (
"fmt"
"io/ioutil"
"net/http"
"testing"
)
func TestStatusService_GetAllStatuses(t *testing.T) {
setup()
defer teardown()
testAPIEdpoint := "/rest/api/2/status"
raw, err := ioutil.ReadFile("./mocks/all_statuses.json")
if err != nil {
t.Error(err.Error())
}
testMux.HandleFunc(testAPIEdpoint, func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "GET")
testRequestURL(t, r, testAPIEdpoint)
fmt.Fprint(w, string(raw))
})
statusList, _, err := testClient.Status.GetAllStatuses()
if statusList == nil {
t.Error("Expected statusList. statusList is nill")
}
if err != nil {
t.Errorf("Error given: %s", err)
}
}