2015-04-23 09:28:02 +00:00
|
|
|
|
2015-10-11 22:59:51 +00:00
|
|
|
'use strict';
|
|
|
|
|
2015-04-23 09:28:02 +00:00
|
|
|
var response = require('../context').response;
|
|
|
|
|
|
|
|
describe('res.header', function(){
|
|
|
|
it('should return the response header object', function(){
|
|
|
|
var res = response();
|
|
|
|
res.set('X-Foo', 'bar');
|
|
|
|
res.headers.should.eql({ 'x-foo': 'bar' });
|
|
|
|
})
|
|
|
|
|
|
|
|
describe('when res._headers not present', function (){
|
|
|
|
it('should return empty object', function (){
|
|
|
|
var res = response();
|
|
|
|
res.res._headers = null;
|
|
|
|
res.headers.should.eql({});
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|