diff options
author | 6543 <6543@obermui.de> | 2020-06-10 00:01:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-09 18:01:36 -0400 |
commit | 1ac46186ff004861a786a81fe045beddaf790407 (patch) | |
tree | 179108d99d750bc77fb3a5ce5b6ccd865de807ea /integrations | |
parent | 19db3f4f0a6739e10aaa36d86ef5fd89dcf71467 (diff) | |
download | gitea-1ac46186ff004861a786a81fe045beddaf790407.tar.gz gitea-1ac46186ff004861a786a81fe045beddaf790407.zip |
API allow to create closed milestones (#11745)
* API allow to create closed milestones
* set CloseDate too
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'integrations')
-rw-r--r-- | integrations/api_issue_milestone_test.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/integrations/api_issue_milestone_test.go b/integrations/api_issue_milestone_test.go index 35e5053cba..f1f306b768 100644 --- a/integrations/api_issue_milestone_test.go +++ b/integrations/api_issue_milestone_test.go @@ -44,4 +44,17 @@ func TestAPIIssuesMilestone(t *testing.T) { var apiMilestone2 structs.Milestone DecodeJSON(t, resp, &apiMilestone2) assert.EqualValues(t, "closed", apiMilestone2.State) + + req = NewRequestWithJSON(t, "POST", fmt.Sprintf("/api/v1/repos/%s/%s/milestones?token=%s", owner.Name, repo.Name, token), structs.CreateMilestoneOption{ + Title: "wow", + Description: "closed one", + State: "closed", + }) + resp = session.MakeRequest(t, req, http.StatusCreated) + DecodeJSON(t, resp, &apiMilestone) + assert.Equal(t, "wow", apiMilestone.Title) + assert.Equal(t, structs.StateClosed, apiMilestone.State) + + req = NewRequest(t, "DELETE", fmt.Sprintf("/api/v1/repos/%s/%s/milestones/%d?token=%s", owner.Name, repo.Name, apiMilestone.ID, token)) + resp = session.MakeRequest(t, req, http.StatusNoContent) } |