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_commits_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_commits_test.go')
-rw-r--r-- | integrations/repo_commits_test.go | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/integrations/repo_commits_test.go b/integrations/repo_commits_test.go index 9be9b78e53..476458e63f 100644 --- a/integrations/repo_commits_test.go +++ b/integrations/repo_commits_test.go @@ -19,8 +19,7 @@ func TestRepoCommits(t *testing.T) { session := loginUser(t, "user2", "password") // Request repository commits page - req, err := http.NewRequest("GET", "/user2/repo1/commits/master", nil) - assert.NoError(t, err) + req := NewRequest(t, "GET", "/user2/repo1/commits/master") resp := session.MakeRequest(t, req) assert.EqualValues(t, http.StatusOK, resp.HeaderCode) @@ -37,8 +36,7 @@ func doTestRepoCommitWithStatus(t *testing.T, state string, classes ...string) { session := loginUser(t, "user2", "password") // Request repository commits page - req, err := http.NewRequest("GET", "/user2/repo1/commits/master", nil) - assert.NoError(t, err) + req := NewRequest(t, "GET", "/user2/repo1/commits/master") resp := session.MakeRequest(t, req) assert.EqualValues(t, http.StatusOK, resp.HeaderCode) @@ -50,16 +48,14 @@ func doTestRepoCommitWithStatus(t *testing.T, state string, classes ...string) { assert.NotEmpty(t, commitURL) // Call API to add status for commit - req, err = http.NewRequest("POST", "/api/v1/repos/user2/repo1/statuses/"+path.Base(commitURL), + req = NewRequestBody(t, "POST", "/api/v1/repos/user2/repo1/statuses/"+path.Base(commitURL), bytes.NewBufferString("{\"state\":\""+state+"\", \"target_url\": \"http://test.ci/\", \"description\": \"\", \"context\": \"testci\"}")) - assert.NoError(t, err) req.Header.Add("Content-Type", "application/json") resp = session.MakeRequest(t, req) assert.EqualValues(t, http.StatusCreated, resp.HeaderCode) - req, err = http.NewRequest("GET", "/user2/repo1/commits/master", nil) - assert.NoError(t, err) + req = NewRequest(t, "GET", "/user2/repo1/commits/master") resp = session.MakeRequest(t, req) assert.EqualValues(t, http.StatusOK, resp.HeaderCode) |