with supertest, I can test the redirection code 302
var request = require('supertest');
var app = require('../server').app;
describe('test route', function(){
it('return 302', function(done){
request(app)
.get('/fail_id')
.expect(302, done);
});
it('redirect to /');
});
how I can test the url objetive to redirect ?
it('redirect to /', function(done){
request(app)
.get('/fail_id')
.expect('Location', /\//, done);
});