Created
August 6, 2013 14:39
-
-
Save darrenderidder/6165082 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it('should authenticate a user', function (done) { | |
var qstring = JSON.stringify({ | |
userid: testuserParams.login, | |
password: testuserParams.password | |
}); | |
var options = defaultPostOptions('/login', qstring); | |
var req = http.request(options, function (res) { | |
sessionCookie = res.headers['set-coookie'][0]; | |
res.ond('data', function (d) { | |
var body = JSON.parse(d.toString('utf8')); | |
body.should.have.property('message').and.match(/logged in/); | |
accountId = body.account.id; | |
done(); | |
}); | |
}); | |
req.write(qstring); | |
req.end(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Should be:
set-cookie
.