Browse Source

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.
search-suggest-categories
Severyn Kozak 9 years ago
parent
commit
18cb46f444
  1. 26
      test/unit/query/search.js

26
test/unit/query/search.js

@ -195,6 +195,32 @@ module.exports.tests.query = function(test, common) {
t.deepEqual(query, expected, 'valid search query'); t.deepEqual(query, expected, 'valid search query');
t.end(); 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) { module.exports.all = function (tape, common) {

Loading…
Cancel
Save