|
|
@ -57,18 +57,10 @@ module.exports.tests.functional_success = function(test, common) { |
|
|
|
if( cmd.body.docs ){ |
|
|
|
if( cmd.body.docs ){ |
|
|
|
t.deepEqual(cmd, {
|
|
|
|
t.deepEqual(cmd, {
|
|
|
|
body: { docs: [
|
|
|
|
body: { docs: [
|
|
|
|
{ _id: 'mockid2', _index: 'pelias', _type: 'mocktype' },
|
|
|
|
{ _id: 'mockid1', _index: 'pelias', _type: 'mocktype' },
|
|
|
|
{ _id: 'mockid1', _index: 'pelias', _type: 'mocktype' } |
|
|
|
{ _id: 'mockid2', _index: 'pelias', _type: 'mocktype' } |
|
|
|
]} |
|
|
|
]} |
|
|
|
}, 'correct mget command'); |
|
|
|
}, 'correct mget command'); |
|
|
|
} else if (cmd.body.layers) { |
|
|
|
|
|
|
|
// layers are set exclusively for admin: test for admin-only layers
|
|
|
|
|
|
|
|
t.deepEqual(cmd, {
|
|
|
|
|
|
|
|
body: {
|
|
|
|
|
|
|
|
input: 'b',
|
|
|
|
|
|
|
|
layers: [ 'admin0', 'admin1', 'admin2' ]
|
|
|
|
|
|
|
|
}, index: 'pelias'
|
|
|
|
|
|
|
|
}, 'correct suggest/admin command'); |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
t.deepEqual(cmd, { body: { input: 'b' }, index: 'pelias' }, 'correct suggest command'); |
|
|
|
t.deepEqual(cmd, { body: { input: 'b' }, index: 'pelias' }, 'correct suggest command'); |
|
|
|
} |
|
|
|
} |
|
|
@ -84,7 +76,7 @@ module.exports.tests.functional_success = function(test, common) { |
|
|
|
t.equal(typeof json.date, 'number', 'date set'); |
|
|
|
t.equal(typeof json.date, 'number', 'date set'); |
|
|
|
t.equal(json.type, 'FeatureCollection', 'valid geojson'); |
|
|
|
t.equal(json.type, 'FeatureCollection', 'valid geojson'); |
|
|
|
t.true(Array.isArray(json.features), 'features is array'); |
|
|
|
t.true(Array.isArray(json.features), 'features is array'); |
|
|
|
// t.deepEqual(json.features, expected, 'values correctly mapped');
|
|
|
|
t.deepEqual(json.features, expected, 'values correctly mapped'); |
|
|
|
t.end(); |
|
|
|
t.end(); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|