I can\'t seem to get the following integration test to pass in an express project using mocha, supertest, and should (and coffeescript).
The test<
There is built-in assertion for this in supertest
:
should = require('should')
request = require('supertest')
app = require('../../app')
describe 'authentication', ->
describe 'POST /sessions', ->
describe 'success', ->
it 'redirects to the right path', (done) ->
request(app)
.post('/sessions')
.send(user: 'username', password: 'password')
.expect(302)
.expect('Location', '/home')
.end(done)