2015-04-23 09:28:02 +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;
|
2015-04-23 09:28:02 +00:00
|
|
|
|
2015-10-25 07:54:57 +00:00
|
|
|
describe('res.header', () => {
|
|
|
|
it('should return the response header object', () => {
|
2015-10-05 18:23:47 +00:00
|
|
|
const res = response();
|
2015-04-23 09:28:02 +00:00
|
|
|
res.set('X-Foo', 'bar');
|
|
|
|
res.headers.should.eql({ 'x-foo': 'bar' });
|
2015-10-12 20:36:41 +00:00
|
|
|
});
|
2015-04-23 09:28:02 +00:00
|
|
|
|
2015-10-25 07:54:57 +00:00
|
|
|
describe('when res._headers not present', () => {
|
|
|
|
it('should return empty object', () => {
|
2015-10-05 18:23:47 +00:00
|
|
|
const res = response();
|
2015-04-23 09:28:02 +00:00
|
|
|
res.res._headers = null;
|
|
|
|
res.headers.should.eql({});
|
2015-10-12 20:36:41 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|