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_commits_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_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 69db24c453..bf35398245 100644 --- a/integrations/repo_commits_test.go +++ b/integrations/repo_commits_test.go @@ -21,8 +21,7 @@ func TestRepoCommits(t *testing.T) { // Request repository commits page req := NewRequest(t, "GET", "/user2/repo1/commits/master") - resp := session.MakeRequest(t, req) - assert.EqualValues(t, http.StatusOK, resp.HeaderCode) + resp := session.MakeRequest(t, req, http.StatusOK) doc := NewHTMLParser(t, resp.Body) commitURL, exists := doc.doc.Find("#commits-table tbody tr td.sha a").Attr("href") @@ -37,8 +36,7 @@ func doTestRepoCommitWithStatus(t *testing.T, state string, classes ...string) { // Request repository commits page req := NewRequest(t, "GET", "/user2/repo1/commits/master") - resp := session.MakeRequest(t, req) - assert.EqualValues(t, http.StatusOK, resp.HeaderCode) + resp := session.MakeRequest(t, req, http.StatusOK) doc := NewHTMLParser(t, resp.Body) // Get first commit URL @@ -56,12 +54,10 @@ func doTestRepoCommitWithStatus(t *testing.T, state string, classes ...string) { }, ) - resp = session.MakeRequest(t, req) - assert.EqualValues(t, http.StatusCreated, resp.HeaderCode) + resp = session.MakeRequest(t, req, http.StatusCreated) req = NewRequest(t, "GET", "/user2/repo1/commits/master") - resp = session.MakeRequest(t, req) - assert.EqualValues(t, http.StatusOK, resp.HeaderCode) + resp = session.MakeRequest(t, req, http.StatusOK) doc = NewHTMLParser(t, resp.Body) // Check if commit status is displayed in message column |