1
0
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:
hirakiuc
2019-08-25 10:25:32 +09:00
committed by Wes McNamee
parent fd698c5716
commit ebae19dda6
3 changed files with 150 additions and 0 deletions

View File

@ -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")
}
}