forked from forgejo/forgejo
Less verbose integration tests (#2123)
* Helper functions for intergration test boilerplate
This commit is contained in:
parent
5651cc7413
commit
f1adaef458
24 changed files with 121 additions and 222 deletions
|
@ -7,22 +7,18 @@ package integrations
|
|||
import (
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestAPIUserReposNotLogin(t *testing.T) {
|
||||
prepareTestEnv(t)
|
||||
|
||||
req := NewRequest(t, "GET", "/api/v1/users/user2/repos")
|
||||
resp := MakeRequest(req)
|
||||
assert.EqualValues(t, http.StatusOK, resp.HeaderCode)
|
||||
MakeRequest(t, req, http.StatusOK)
|
||||
}
|
||||
|
||||
func TestAPISearchRepoNotLogin(t *testing.T) {
|
||||
prepareTestEnv(t)
|
||||
|
||||
req := NewRequest(t, "GET", "/api/v1/repos/search?q=Test")
|
||||
resp := MakeRequest(req)
|
||||
assert.EqualValues(t, http.StatusOK, resp.HeaderCode)
|
||||
MakeRequest(t, req, http.StatusOK)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue