diff options
author | Ethan Koenig <etk39@cornell.edu> | 2017-06-09 20:41:36 -0400 |
---|---|---|
committer | Bo-Yi Wu <appleboy.tw@gmail.com> | 2017-06-09 19:41:36 -0500 |
commit | 61716bd8f70f55f2c5d4090c87700f6b9b6fc632 (patch) | |
tree | d3bab40ab681e0ccbbba964273ba32f6d0ace8e0 /integrations/repo_fork_test.go | |
parent | 6d613fb28ef5d884bbea1e2a4d8c3e21fc398ecc (diff) | |
download | gitea-61716bd8f70f55f2c5d4090c87700f6b9b6fc632.tar.gz gitea-61716bd8f70f55f2c5d4090c87700f6b9b6fc632.zip |
Display URLs in integration test logs (#1924)
Diffstat (limited to 'integrations/repo_fork_test.go')
-rw-r--r-- | integrations/repo_fork_test.go | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/integrations/repo_fork_test.go b/integrations/repo_fork_test.go index 15c096b1ab..59a15d8483 100644 --- a/integrations/repo_fork_test.go +++ b/integrations/repo_fork_test.go @@ -15,14 +15,12 @@ import ( func testRepoFork(t *testing.T, session *TestSession) { // Step0: check the existence of the to-fork repo - req, err := http.NewRequest("GET", "/user1/repo1", nil) - assert.NoError(t, err) + req := NewRequest(t, "GET", "/user1/repo1") resp := session.MakeRequest(t, req) assert.EqualValues(t, http.StatusNotFound, resp.HeaderCode) // Step1: go to the main page of repo - req, err = http.NewRequest("GET", "/user2/repo1", nil) - assert.NoError(t, err) + req = NewRequest(t, "GET", "/user2/repo1") resp = session.MakeRequest(t, req) assert.EqualValues(t, http.StatusOK, resp.HeaderCode) @@ -31,8 +29,7 @@ func testRepoFork(t *testing.T, session *TestSession) { assert.NoError(t, err) link, exists := htmlDoc.doc.Find("a.ui.button[href^=\"/repo/fork/\"]").Attr("href") assert.True(t, exists, "The template has changed") - req, err = http.NewRequest("GET", link, nil) - assert.NoError(t, err) + req = NewRequest(t, "GET", link) resp = session.MakeRequest(t, req) assert.EqualValues(t, http.StatusOK, resp.HeaderCode) @@ -41,21 +38,19 @@ func testRepoFork(t *testing.T, session *TestSession) { assert.NoError(t, err) link, exists = htmlDoc.doc.Find("form.ui.form[action^=\"/repo/fork/\"]").Attr("action") assert.True(t, exists, "The template has changed") - req, err = http.NewRequest("POST", link, + req = NewRequestBody(t, "POST", link, bytes.NewBufferString(url.Values{ "_csrf": []string{htmlDoc.GetInputValueByName("_csrf")}, "uid": []string{"1"}, "repo_name": []string{"repo1"}, }.Encode()), ) - assert.NoError(t, err) req.Header.Add("Content-Type", "application/x-www-form-urlencoded") resp = session.MakeRequest(t, req) assert.EqualValues(t, http.StatusFound, resp.HeaderCode) // Step4: check the existence of the forked repo - req, err = http.NewRequest("GET", "/user1/repo1", nil) - assert.NoError(t, err) + req = NewRequest(t, "GET", "/user1/repo1") resp = session.MakeRequest(t, req) assert.EqualValues(t, http.StatusOK, resp.HeaderCode) } |