Last active
January 6, 2016 02:44
-
-
Save miyamotodev123/68570842c345e60d1c47 to your computer and use it in GitHub Desktop.
This file contains 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
var app = require('../../server.js'), | |
should = require('should'), | |
request = require('supertest'), | |
api = request(app); | |
describe('testing user authentication endpoints', function () { | |
it('successfully created a user', function (done) { | |
// make a post reqeust to the /signup route | |
api.post('/signup') | |
// send an email and password as part of the request body | |
.send({ | |
email: 'foobar', | |
password: 'password' | |
}) | |
.expect(200) // check to see that the response status is the expected 200 status | |
.end(function (err, res) { | |
if (err) return done(err); | |
// check to see that the response body returns the expected | |
// json object of {redirect: '/profile'} | |
res.body.should.eql({redirect: '/profile'}); | |
done(); | |
}) | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment