summaryrefslogtreecommitdiffstats
path: root/integrations/branches_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'integrations/branches_test.go')
-rw-r--r--integrations/branches_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/integrations/branches_test.go b/integrations/branches_test.go
index 7fb57242d9..01c6dd2a4b 100644
--- a/integrations/branches_test.go
+++ b/integrations/branches_test.go
@@ -59,9 +59,8 @@ func branchAction(t *testing.T, button string) (*HTMLDoc, string) {
link, exists := htmlDoc.doc.Find(button).Attr("data-url")
assert.True(t, exists, "The template has changed")
- htmlDoc = NewHTMLParser(t, resp.Body)
req = NewRequestWithValues(t, "POST", link, map[string]string{
- "_csrf": getCsrf(htmlDoc.doc),
+ "_csrf": getCsrf(t, htmlDoc.doc),
})
resp = session.MakeRequest(t, req, http.StatusOK)
@@ -73,7 +72,8 @@ func branchAction(t *testing.T, button string) (*HTMLDoc, string) {
return NewHTMLParser(t, resp.Body), url.Query()["name"][0]
}
-func getCsrf(doc *goquery.Document) string {
- csrf, _ := doc.Find("meta[name=\"_csrf\"]").Attr("content")
+func getCsrf(t *testing.T, doc *goquery.Document) string {
+ csrf, exists := doc.Find("meta[name=\"_csrf\"]").Attr("content")
+ assert.True(t, exists)
return csrf
}