mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-01 21:30:30 +01:00
test: empty query params for search
This commit is contained in:
@@ -273,4 +273,20 @@ describe('Search', () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('should not crash without a search term', (done) => {
|
||||
const qs = '/api/search';
|
||||
privileges.global.give(['groups:search:content'], 'guests', (err) => {
|
||||
assert.ifError(err);
|
||||
request({
|
||||
url: nconf.get('url') + qs,
|
||||
json: true,
|
||||
}, (err, response, body) => {
|
||||
assert.ifError(err);
|
||||
assert(body);
|
||||
assert.strictEqual(response.statusCode, 200);
|
||||
privileges.global.rescind(['groups:search:content'], 'guests', done);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user