2014-07-06 08:43:14 +00:00
|
|
|
|
2015-10-11 22:59:51 +00:00
|
|
|
'use strict';
|
|
|
|
|
2015-10-12 04:59:30 +00:00
|
|
|
const request = require('../helpers/context').request;
|
2015-10-05 18:23:47 +00:00
|
|
|
const assert = require('assert');
|
2014-07-06 08:43:14 +00:00
|
|
|
|
|
|
|
describe('ctx.length', function(){
|
|
|
|
it('should return length in content-length', function(){
|
2015-10-05 18:23:47 +00:00
|
|
|
const req = request();
|
2014-07-06 08:43:14 +00:00
|
|
|
req.header['content-length'] = '10';
|
|
|
|
req.length.should.equal(10);
|
|
|
|
})
|
|
|
|
|
|
|
|
describe('with no content-length present', function(){
|
2015-10-05 18:23:47 +00:00
|
|
|
const req = request();
|
2014-07-06 08:43:14 +00:00
|
|
|
assert(null == req.length);
|
|
|
|
})
|
|
|
|
})
|