2014-10-01 12:12:20 +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-10-05 18:23:47 +00:00
|
|
|
const Stream = require('stream');
|
2014-10-01 12:12:20 +00:00
|
|
|
|
|
|
|
describe('res.message', function(){
|
|
|
|
it('should return the response status message', function(){
|
2015-10-05 18:23:47 +00:00
|
|
|
const res = response();
|
2014-10-01 12:12:20 +00:00
|
|
|
res.status = 200;
|
|
|
|
res.message.should.equal('OK');
|
|
|
|
})
|
|
|
|
|
|
|
|
describe('when res.message not present', function(){
|
|
|
|
it('should look up in statuses', function(){
|
2015-10-05 18:23:47 +00:00
|
|
|
const res = response();
|
2014-10-01 12:12:20 +00:00
|
|
|
res.res.statusCode = 200;
|
|
|
|
res.message.should.equal('OK');
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
describe('res.message=', function(){
|
|
|
|
it('should set response status message', function(){
|
2015-10-05 18:23:47 +00:00
|
|
|
const res = response();
|
2014-10-01 12:12:20 +00:00
|
|
|
res.status = 200;
|
|
|
|
res.message = 'ok';
|
|
|
|
res.res.statusMessage.should.equal('ok');
|
|
|
|
res.inspect().message.should.equal('ok');
|
|
|
|
})
|
|
|
|
})
|