|
|
|
@ -62,7 +62,7 @@ module.exports.tests.functional_success = function(test, common) {
|
|
|
|
|
]} |
|
|
|
|
}, 'correct mget command'); |
|
|
|
|
} else { |
|
|
|
|
t.deepEqual(cmd, { body: { input: 'b' }, index: 'pelias' }, 'correct suggest command'); |
|
|
|
|
t.deepEqual(cmd, { body: { input: 'b' }, index: 'pelias_ngram' }, 'correct suggest command'); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
var controller = setup( backend, mockQuery() ); |
|
|
|
@ -91,16 +91,16 @@ module.exports.tests.functional_failure = function(test, common) {
|
|
|
|
|
if( cmd.body.docs ){ |
|
|
|
|
t.deepEqual(cmd, {
|
|
|
|
|
body: { docs: [
|
|
|
|
|
{ _id: 'mockid1', _index: 'pelias', _type: 'mocktype' },
|
|
|
|
|
{ _id: 'mockid2', _index: 'pelias', _type: 'mocktype' }]
|
|
|
|
|
{ _id: 'mockid1', _index: 'pelias_ngram', _type: 'mocktype' },
|
|
|
|
|
{ _id: 'mockid2', _index: 'pelias_ngram', _type: 'mocktype' }]
|
|
|
|
|
}
|
|
|
|
|
}, 'correct mget command'); |
|
|
|
|
} else if (cmd.body.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_ngram' },
|
|
|
|
|
'correct suggest/admin command'); |
|
|
|
|
} else { |
|
|
|
|
t.deepEqual(cmd, { body: { a: 'b' }, index: 'pelias' }, 'correct suggest command'); |
|
|
|
|
t.deepEqual(cmd, { body: { a: 'b' }, index: 'pelias_ngram' }, 'correct suggest command'); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
var controller = setup( backend, mockQuery() ); |
|
|
|
|