Less verbose integration tests (#2123)

* Helper functions for intergration test boilerplate
This commit is contained in:
Ethan Koenig
2017-07-07 15:36:47 -04:00
committed by Kim "BKC" Carlbäcker
parent 5651cc7413
commit f1adaef458
24 changed files with 121 additions and 222 deletions

View File

@ -9,8 +9,6 @@ import (
"testing"
"code.gitea.io/gitea/modules/setting"
"github.com/stretchr/testify/assert"
)
func TestSignup(t *testing.T) {
@ -24,11 +22,9 @@ func TestSignup(t *testing.T) {
"password": "examplePassword",
"retype": "examplePassword",
})
resp := MakeRequest(req)
assert.EqualValues(t, http.StatusFound, resp.HeaderCode)
MakeRequest(t, req, http.StatusFound)
// should be able to view new user's page
req = NewRequest(t, "GET", "/exampleUser")
resp = MakeRequest(req)
assert.EqualValues(t, http.StatusOK, resp.HeaderCode)
MakeRequest(t, req, http.StatusOK)
}