1
0
Fork 0
forked from forgejo/forgejo

[FEAT] allow setting the update date on issues and comments (squash) do not use token= query param

See 33439b733a
This commit is contained in:
Earl Warren 2023-12-25 12:29:23 +01:00
parent 868b7a436f
commit c5139a75b9
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
5 changed files with 44 additions and 44 deletions

View file

@ -125,15 +125,15 @@ func TestAPIAddIssueLabelsAutoDate(t *testing.T) {
session := loginUser(t, owner.Name)
token := getTokenForLoggedInUser(t, session, auth_model.AccessTokenScopeWriteIssue)
urlStr := fmt.Sprintf("/api/v1/repos/%s/%s/issues/%d/labels?token=%s",
owner.Name, repo.Name, issueBefore.Index, token)
urlStr := fmt.Sprintf("/api/v1/repos/%s/%s/issues/%d/labels",
owner.Name, repo.Name, issueBefore.Index)
t.Run("WithAutoDate", func(t *testing.T) {
defer tests.PrintCurrentTest(t)()
req := NewRequestWithJSON(t, "POST", urlStr, &api.IssueLabelsOption{
Labels: []int64{1},
})
}).AddTokenAuth(token)
MakeRequest(t, req, http.StatusOK)
issueAfter := unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: issueBefore.ID})
@ -149,7 +149,7 @@ func TestAPIAddIssueLabelsAutoDate(t *testing.T) {
req := NewRequestWithJSON(t, "POST", urlStr, &api.IssueLabelsOption{
Labels: []int64{2},
Updated: &updatedAt,
})
}).AddTokenAuth(token)
MakeRequest(t, req, http.StatusOK)
// dates will be converted into the same tz, in order to compare them