Browse Source

functional failure test fixed

fuzzy
Harish Krishna 10 years ago
parent
commit
a1d4d79431
  1. 52
      test/unit/controller/suggest.js

52
test/unit/controller/suggest.js

@ -93,32 +93,32 @@ module.exports.tests.functional_success = function(test, common) {
}; };
// functionally test controller (backend failure) // functionally test controller (backend failure)
// module.exports.tests.functional_failure = function(test, common) { module.exports.tests.functional_failure = function(test, common) {
// test('functional failure', function(t) { test('functional failure', function(t) {
// var backend = mockBackend( 'client/suggest/fail/1', function( cmd ){ var backend = mockBackend( 'client/suggest/fail/1', function( cmd ){
// if( cmd.body.docs ){ if( cmd.body.docs ){
// t.deepEqual(cmd, { t.deepEqual(cmd, {
// body: { docs: [ body: { docs: [
// { _id: 'mockid1', _index: 'pelias', _type: 'mocktype' }, { _id: 'mockid1', _index: 'pelias', _type: 'mocktype' },
// { _id: 'mockid2', _index: 'pelias', _type: 'mocktype' }] { _id: 'mockid2', _index: 'pelias', _type: 'mocktype' }]
// } }
// }, 'correct mget command'); }, 'correct mget command');
// } else if (cmd.body.layers) { } else if (cmd.body.layers) {
// // layers are set exclusively for admin: test for admin-only layers // layers are set exclusively for admin: test for admin-only layers
// t.deepEqual(cmd, { body: { a: 'b', layers: [ 'admin0', 'admin1', 'admin2' ] }, index: 'pelias' }, t.deepEqual(cmd, { body: { a: 'b', layers: [ 'admin0', 'admin1', 'admin2' ] }, index: 'pelias' },
// 'correct suggest/admin command'); 'correct suggest/admin command');
// } else { } else {
// t.deepEqual(cmd, { body: { a: 'b' }, index: 'pelias' }, 'correct suggest command'); t.deepEqual(cmd, { body: { a: 'b' }, index: 'pelias' }, 'correct suggest command');
// } }
// }); });
// var controller = setup( backend, mockQuery() ); var controller = setup( backend, mockQuery() );
// var next = function( message ){ var next = function( message ){
// t.equal(message,'a backend error occurred','error passed to errorHandler'); t.equal(message,'a backend error occurred','error passed to errorHandler');
// t.end(); };
// }; controller( { clean: { a: 'b' } }, undefined, next );
// controller( { clean: { a: 'b' } }, undefined, next ); t.end();
// }); });
// }; };
module.exports.all = function (tape, common) { module.exports.all = function (tape, common) {

Loading…
Cancel
Save