Consolidate boilerplate in integration tests (#1979)

This commit is contained in:
Ethan Koenig 2017-06-17 00:49:45 -04:00 committed by Lunny Xiao
parent a3868ef536
commit ce9b86082c
16 changed files with 147 additions and 166 deletions

View file

@ -14,12 +14,11 @@ import (
func TestPullCompare(t *testing.T) {
prepareTestEnv(t)
session := loginUser(t, "user2", "password")
session := loginUser(t, "user2")
req := NewRequest(t, "GET", "/user2/repo1/pulls")
resp := session.MakeRequest(t, req)
assert.EqualValues(t, http.StatusOK, resp.HeaderCode)
htmlDoc, err := NewHtmlParser(resp.Body)
assert.NoError(t, err)
htmlDoc := NewHtmlParser(t, resp.Body)
link, exists := htmlDoc.doc.Find(".navbar").Find(".ui.green.button").Attr("href")
assert.True(t, exists, "The template has changed")