1 |
|
2 | var query = require('../query/geohash_cell');
|
3 |
|
4 | module.exports.query = {};
|
5 |
|
6 | module.exports.query.generate = function(test, common) {
|
7 | test('generate', function(t) {
|
8 | var centroid = { lat: 1, lon: 1 };
|
9 | var q = query(centroid, { distance: '999km' });
|
10 | var must = q.query.filtered.filter.bool.must;
|
11 |
|
12 | t.equal(Array.isArray(must), true, 'correct bool filter');
|
13 | t.equal(must[0]['geohash_cell']['neighbors'], true, 'correct geohash_cell filter');
|
14 | t.end();
|
15 | });
|
16 | }
|
17 |
|
18 | module.exports.all = function (tape, common) {
|
19 |
|
20 | function test(name, testFunction) {
|
21 | return tape('reverse-geocode geohash_cell query: ' + name, testFunction)
|
22 | }
|
23 |
|
24 | for( var testCase in module.exports.query ){
|
25 | module.exports.query[testCase](test, common);
|
26 | }
|
27 | } |
\ | No newline at end of file |