Add test for operation hooks

* Add test for operation hook when near filter is used
This commit is contained in:
Amir Jafarian 2016-10-04 16:50:48 -04:00
parent 1ee04421c0
commit f5e9b53289
1 changed files with 12 additions and 0 deletions

View File

@ -99,6 +99,18 @@ module.exports = function(dataSource, should, connectorCapabilities) {
}); });
}); });
it('triggers correct hooks when near filter is used', function(done) {
monitorHookExecution();
var query = {
where: {location: {near: '10,20', maxDistance: '10', unit: 'meters'}},
};
TestModel.find(query, function(err, list) {
if (err) return done(err);
hookMonitor.names.should.eql(['access']);
done();
});
});
it('should not trigger hooks for geo queries, if notify is false', it('should not trigger hooks for geo queries, if notify is false',
function(done) { function(done) {
monitorHookExecution(); monitorHookExecution();