2013-11-13 17:01:15 +00:00
|
|
|
|
2015-10-11 22:59:51 +00:00
|
|
|
'use strict';
|
|
|
|
|
2015-10-12 04:59:30 +00:00
|
|
|
const response = require('../helpers/context').response;
|
2013-11-13 17:01:15 +00:00
|
|
|
|
|
|
|
describe('res.header', function(){
|
|
|
|
it('should return the response header object', function(){
|
2015-10-05 18:23:47 +00:00
|
|
|
const res = response();
|
2013-11-13 17:01:15 +00:00
|
|
|
res.set('X-Foo', 'bar');
|
|
|
|
res.header.should.eql({ 'x-foo': 'bar' });
|
|
|
|
})
|
2014-10-01 12:42:29 +00:00
|
|
|
|
|
|
|
describe('when res._headers not present', function (){
|
|
|
|
it('should return empty object', function (){
|
2015-10-05 18:23:47 +00:00
|
|
|
const res = response();
|
2014-10-01 12:42:29 +00:00
|
|
|
res.res._headers = null;
|
|
|
|
res.header.should.eql({});
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|