do null check on csrf token in smoke test

This commit is contained in:
Henry Oswald 2014-11-10 11:20:34 +00:00
parent e9232eb197
commit 4c905c168a

View file

@ -18,7 +18,11 @@ describe "Opening", ->
"""
child.exec command, (err, stdout, stderr)->
if err? then done(err)
csrf = stdout.match("<input name=\"_csrf\" type=\"hidden\" value=\"(.*?)\">")[1]
csrfMatches = stdout.match("<input name=\"_csrf\" type=\"hidden\" value=\"(.*?)\">")
if !csrfMatches?
logger.err stdout:stdout, "smoke test: does not hace csrf token"
return("smoke test: does not hace csrf token")
csrf = csrfMatches[1]
# Change cookie to be non secure so curl will send it
fs = require("fs")