diff options
author | Ethan Koenig <etk39@cornell.edu> | 2017-07-07 15:36:47 -0400 |
---|---|---|
committer | Kim "BKC" Carlbäcker <kim.carlbacker@gmail.com> | 2017-07-07 21:36:47 +0200 |
commit | f1adaef45849fc260b07be39a39b9c1ee5146923 (patch) | |
tree | bc33151ef4021ae14adf2e6cfc694b9e4729cef8 /integrations/repo_test.go | |
parent | 5651cc7413640f12a9eb8dee64d332ea9597afce (diff) | |
download | gitea-f1adaef45849fc260b07be39a39b9c1ee5146923.tar.gz gitea-f1adaef45849fc260b07be39a39b9c1ee5146923.zip |
Less verbose integration tests (#2123)
* Helper functions for intergration test boilerplate
Diffstat (limited to 'integrations/repo_test.go')
-rw-r--r-- | integrations/repo_test.go | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/integrations/repo_test.go b/integrations/repo_test.go index 23df6d733c..004156b446 100644 --- a/integrations/repo_test.go +++ b/integrations/repo_test.go @@ -7,24 +7,19 @@ package integrations import ( "net/http" "testing" - - "github.com/stretchr/testify/assert" ) func TestViewRepo(t *testing.T) { prepareTestEnv(t) req := NewRequest(t, "GET", "/user2/repo1") - resp := MakeRequest(req) - assert.EqualValues(t, http.StatusOK, resp.HeaderCode) + MakeRequest(t, req, http.StatusOK) req = NewRequest(t, "GET", "/user3/repo3") - resp = MakeRequest(req) - assert.EqualValues(t, http.StatusNotFound, resp.HeaderCode) + MakeRequest(t, req, http.StatusNotFound) session := loginUser(t, "user1") - resp = session.MakeRequest(t, req) - assert.EqualValues(t, http.StatusNotFound, resp.HeaderCode) + session.MakeRequest(t, req, http.StatusNotFound) } func TestViewRepo2(t *testing.T) { @@ -32,8 +27,7 @@ func TestViewRepo2(t *testing.T) { req := NewRequest(t, "GET", "/user3/repo3") session := loginUser(t, "user2") - resp := session.MakeRequest(t, req) - assert.EqualValues(t, http.StatusOK, resp.HeaderCode) + session.MakeRequest(t, req, http.StatusOK) } func TestViewRepo3(t *testing.T) { @@ -41,6 +35,5 @@ func TestViewRepo3(t *testing.T) { req := NewRequest(t, "GET", "/user3/repo3") session := loginUser(t, "user3") - resp := session.MakeRequest(t, req) - assert.EqualValues(t, http.StatusOK, resp.HeaderCode) + session.MakeRequest(t, req, http.StatusOK) } |