forked from forgejo/forgejo
Improve integration test helper functions (#2049)
Set request headers in helper functions, and new helper for requests with string-formatted URLs
This commit is contained in:
parent
3ffedeab03
commit
f64c232953
13 changed files with 9 additions and 24 deletions
|
@ -5,7 +5,6 @@
|
|||
package integrations
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
|
@ -25,9 +24,8 @@ func TestAPIListComments(t *testing.T) {
|
|||
repoOwner := models.AssertExistsAndLoadBean(t, &models.User{ID: repo.OwnerID}).(*models.User)
|
||||
|
||||
session := loginUser(t, repoOwner.Name)
|
||||
requestUrl := fmt.Sprintf("/api/v1/repos/%s/%s/issues/%d/comments",
|
||||
req := NewRequestf(t, "GET", "/api/v1/repos/%s/%s/issues/%d/comments",
|
||||
repoOwner.Name, repo.Name, issue.Index)
|
||||
req := NewRequest(t, "GET", requestUrl)
|
||||
resp := session.MakeRequest(t, req)
|
||||
assert.EqualValues(t, http.StatusOK, resp.HeaderCode)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue