
var express = require('../')
  , request = require('./support/http');

describe('app', function(){
  describe('.request', function(){
    it('should extend the request prototype', function(done){
      var app = express();

      app.request.querystring = function(){
        return require('url').parse(this.url).query;
      };

      app.use(function(req, res){
        res.end(req.querystring());
      });

      request(app)
      .get('/foo?name=tobi')
      .end(function(res){
        res.body.should.equal('name=tobi');
        done();
      });
    })
  })
})
