2014-07-06 08:43:14 +00:00
|
|
|
|
2015-10-11 22:59:51 +00:00
|
|
|
'use strict';
|
|
|
|
|
2014-07-06 08:43:14 +00:00
|
|
|
var request = require('../context').request;
|
2014-11-16 13:52:14 +00:00
|
|
|
var assert = require('assert');
|
2014-07-06 08:43:14 +00:00
|
|
|
|
|
|
|
describe('req.type', function(){
|
|
|
|
it('should return type void of parameters', function(){
|
|
|
|
var req = request();
|
|
|
|
req.header['content-type'] = 'text/html; charset=utf-8';
|
|
|
|
req.type.should.equal('text/html');
|
|
|
|
})
|
|
|
|
|
|
|
|
describe('with no host present', function(){
|
|
|
|
var req = request();
|
2015-04-28 17:44:02 +00:00
|
|
|
assert('' === req.type);
|
2014-07-06 08:43:14 +00:00
|
|
|
})
|
|
|
|
})
|