From 18cb46f4445879e54c0e202cc9f936563652cca8 Mon Sep 17 00:00:00 2001 From: Severyn Kozak Date: Tue, 12 May 2015 11:15:01 -0400 Subject: [PATCH] Add a test-case for search with category filtration. test/unit/query/search.js -Add a test case for the addition of category filtration to search in 555ebcb. --- test/unit/query/search.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/test/unit/query/search.js b/test/unit/query/search.js index 4d004552..69b5432b 100644 --- a/test/unit/query/search.js +++ b/test/unit/query/search.js @@ -195,6 +195,32 @@ module.exports.tests.query = function(test, common) { t.deepEqual(query, expected, 'valid search query'); t.end(); }); + + test('valid query with categories', function(t) { + var query = generate({ + input: 'test', + size: 10, + lat: 29.49136, + lon: -82.50622, + bbox: { + top: 47.47, + right: -61.84, + bottom: 11.51, + left: -103.16 + }, + layers: ['test'], + categories: ['narwhal', 'foobar'] + }); + + var expected = createExpectedQuery(); + expected.query.filtered.filter.bool.must.push({ + terms: { + category: ['narwhal', 'foobar'] + } + }); + t.deepEqual(query, expected, 'valid search query'); + t.end(); + }); }; module.exports.all = function (tape, common) {