req.route.js
This file
Path
test/req.route.js
25 lines · 587 bytes · JavaScript
Last changed by
remove app.router and refactor middleware processingRoman Shtylmanbefore adoptionf41d09a
History of this fileTake it
1234567891011121314151617181920212223242526
var express = require('../') , request = require('./support/http');
describe('req', function(){ describe('.route', function(){ it('should be the executed Route', function(done){ var app = express();
app.get('/user/:id/:op?', function(req, res, next){ req.route.path.should.equal('/user/:id/:op?'); next(); }); app.get('/user/:id/edit', function(req, res){ req.route.path.should.equal('/user/:id/edit'); res.end(); });
request(app) .get('/user/12/edit') .expect(200, done); }) })})