req.path.js
This file
Path
test/req.path.js
22 lines · 465 bytes · JavaScript
Last changed by
Added req.path testTj Holowaychukbefore adoption333cf0b
History of this fileTake it
Added req.path testTj Holowaychukbefore adoption333cf0b
lines 1–22why, one step back12var express = require('../')3 , request = require('./support/http');45describe('req', function(){6 describe('.path', function(){7 it('should return the parsed pathname', function(done){8 var app = express();910 app.use(function(req, res){11 res.end(req.path);12 });1314 request(app)15 .get('/login?redirect=/post/1/comments')16 .end(function(res){17 res.body.should.equal('/login');18 done();19 })20 })21 })22})