mirror of
https://github.com/interviewstreet/go-jira.git
synced 2025-06-16 23:47:50 +02:00
feat: Add GetMyFilters to FilterService
This commit is contained in:
@ -76,3 +76,27 @@ func TestFilterService_GetFavouriteList(t *testing.T) {
|
||||
t.Errorf("Error given: %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestFilterService_GetMyFilters(t *testing.T) {
|
||||
setup()
|
||||
defer teardown()
|
||||
testAPIEndpoint := "/rest/api/3/filter/my"
|
||||
raw, err := ioutil.ReadFile("./mocks/my_filters.json")
|
||||
if err != nil {
|
||||
t.Error(err.Error())
|
||||
}
|
||||
testMux.HandleFunc(testAPIEndpoint, func(writer http.ResponseWriter, request *http.Request) {
|
||||
testMethod(t, request, "GET")
|
||||
testRequestURL(t, request, testAPIEndpoint)
|
||||
fmt.Fprint(writer, string(raw))
|
||||
})
|
||||
|
||||
opts := GetMyFiltersQueryOptions{}
|
||||
filters, _, err := testClient.Filter.GetMyFilters(&opts)
|
||||
if err != nil {
|
||||
t.Errorf("Error given: %s", err)
|
||||
}
|
||||
if filters == nil {
|
||||
t.Errorf("Expected Filters, got nil")
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user