2022-02-09 01:07:08 -05:00
|
|
|
'use strict'
|
2011-11-08 20:25:34 -08:00
|
|
|
|
|
|
|
|
var express = require('../')
|
2014-03-05 22:06:14 -08:00
|
|
|
, request = require('supertest');
|
2011-11-08 20:25:34 -08:00
|
|
|
|
|
|
|
|
describe('req', function(){
|
|
|
|
|
describe('.path', function(){
|
|
|
|
|
it('should return the parsed pathname', function(done){
|
|
|
|
|
var app = express();
|
|
|
|
|
|
|
|
|
|
app.use(function(req, res){
|
|
|
|
|
res.end(req.path);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
request(app)
|
|
|
|
|
.get('/login?redirect=/post/1/comments')
|
2012-06-26 17:14:07 -07:00
|
|
|
.expect('/login', done);
|
2011-11-08 20:25:34 -08:00
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})
|