aboutsummaryrefslogtreecommitdiffstats
path: root/integrations
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-04-30 06:15:39 +0200
committerGitHub <noreply@github.com>2020-04-30 01:15:39 -0300
commitbfda0f38646f66dbae2767eed3097489c456ebf5 (patch)
treeb3c915a6fb63215cd2c31c24bf4d7da332503565 /integrations
parentcbf5dffaf29c1e871342c15478b33e9229a7f9d2 (diff)
downloadgitea-bfda0f38646f66dbae2767eed3097489c456ebf5.tar.gz
gitea-bfda0f38646f66dbae2767eed3097489c456ebf5.zip
[API] ListIssues add filter for milestones (#10148)
* Refactor Issue Filter Func * ListIssues add filter for milestones * as per @lafriks * documentation ...
Diffstat (limited to 'integrations')
-rw-r--r--integrations/api_issue_test.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/integrations/api_issue_test.go b/integrations/api_issue_test.go
index 2a6f137747..d742049335 100644
--- a/integrations/api_issue_test.go
+++ b/integrations/api_issue_test.go
@@ -33,6 +33,17 @@ func TestAPIListIssues(t *testing.T) {
for _, apiIssue := range apiIssues {
models.AssertExistsAndLoadBean(t, &models.Issue{ID: apiIssue.ID, RepoID: repo.ID})
}
+
+ // test milestone filter
+ req = NewRequestf(t, "GET", "/api/v1/repos/%s/%s/issues?state=all&type=all&milestones=ignore,milestone1,3,4&token=%s",
+ owner.Name, repo.Name, token)
+ resp = session.MakeRequest(t, req, http.StatusOK)
+ DecodeJSON(t, resp, &apiIssues)
+ if assert.Len(t, apiIssues, 2) {
+ assert.EqualValues(t, 3, apiIssues[0].Milestone.ID)
+ assert.EqualValues(t, 1, apiIssues[1].Milestone.ID)
+ }
+
}
func TestAPICreateIssue(t *testing.T) {