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
|
|
|
|
2015-10-25 07:54:57 +00:00
|
|
|
describe('req.type', () => {
|
|
|
|
it('should return type void of parameters', () => {
|
2015-10-05 18:23:47 +00:00
|
|
|
const req = request();
|
2014-07-06 08:43:14 +00:00
|
|
|
req.header['content-type'] = 'text/html; charset=utf-8';
|
2017-05-11 03:30:32 +00:00
|
|
|
assert.equal(req.type, 'text/html');
|
2015-10-12 20:36:41 +00:00
|
|
|
});
|
2014-07-06 08:43:14 +00:00
|
|
|
|
2017-04-17 04:02:32 +00:00
|
|
|
it('with no host present', () => {
|
2015-10-05 18:23:47 +00:00
|
|
|
const req = request();
|
2017-05-11 03:30:32 +00:00
|
|
|
assert.equal(req.type, '');
|
2015-10-12 20:36:41 +00:00
|
|
|
});
|
|
|
|
});
|