Skip to content
Myr

Added url rewriting test

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by TJ Holowaychuk · committed by TJ Holowaychuk · parent 125dd7a · Browse files · 1 file+18 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+18 added−0 removed

  • tests:+18 added−0 removed

1 file+18 added−0 removed

modified:test/app.router.js+18 added
549 unmodified lines
550 done();551 })552 })553 })554555 it('should allow rewriting of the url', function(done){556 var app = express();557558 app.get('/account/edit', function(req, res, next){559 req.user = { id: 12 }; // faux authenticated user560 req.url = '/user/' + req.user.id + '/edit';561 next();562 });563564 app.get('/user/:id/edit', function(req, res){565 res.send('editing user ' + req.params.id);566 });567568 request(app)569 .get('/account/edit')570 .expect('editing user 12', done);571 })572})