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;
|
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');
|
2015-10-12 20:36:41 +00:00
|
|
|
});
|
2014-10-01 12:12:20 +00:00
|
|
|
|
|
|
|
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');
|
2015-10-12 20:36:41 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
2014-10-01 12:12:20 +00:00
|
|
|
|
|
|
|
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');
|
2015-10-12 20:36:41 +00:00
|
|
|
});
|
|
|
|
});
|