forked from forgejo/forgejo
Remove session in api tests (#21984)
It's no meaning to request an API route with session.
This commit is contained in:
parent
665d02efaf
commit
df676a47d0
46 changed files with 387 additions and 433 deletions
|
@ -24,14 +24,14 @@ func TestAPIReposGitNotes(t *testing.T) {
|
|||
|
||||
// check invalid requests
|
||||
req := NewRequestf(t, "GET", "/api/v1/repos/%s/repo1/git/notes/12345?token=%s", user.Name, token)
|
||||
session.MakeRequest(t, req, http.StatusNotFound)
|
||||
MakeRequest(t, req, http.StatusNotFound)
|
||||
|
||||
req = NewRequestf(t, "GET", "/api/v1/repos/%s/repo1/git/notes/..?token=%s", user.Name, token)
|
||||
session.MakeRequest(t, req, http.StatusUnprocessableEntity)
|
||||
MakeRequest(t, req, http.StatusUnprocessableEntity)
|
||||
|
||||
// check valid request
|
||||
req = NewRequestf(t, "GET", "/api/v1/repos/%s/repo1/git/notes/65f1bf27bc3bf70f64657658635e66094edbcb4d?token=%s", user.Name, token)
|
||||
resp := session.MakeRequest(t, req, http.StatusOK)
|
||||
resp := MakeRequest(t, req, http.StatusOK)
|
||||
|
||||
var apiData api.Note
|
||||
DecodeJSON(t, resp, &apiData)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue