Browse Source

add additional test case

pull/533/head
Peter Johnson 9 years ago
parent
commit
63d9329afd
  1. 18
      test/unit/middleware/sendJSON.js

18
test/unit/middleware/sendJSON.js

@ -206,6 +206,24 @@ module.exports.tests.search_phase_execution_exception = function(test, common) {
});
};
module.exports.tests.unknown_exception = function(test, common) {
test('unknown exception', function(t) {
var res = { body: { geocoding: {
errors: [ 'MadeUpExceptionName[ foo ]' ]
}}};
res.status = function( code ){
return { json: function( body ){
t.equal( code, 400, '400 Bad Request' );
t.deepEqual( body, res.body, 'body set' );
t.end();
}};
};
middleware(null, res);
});
};
module.exports.all = function (tape, common) {
function test(name, testFunction) {

Loading…
Cancel
Save