Merge pull request #1125 from strongloop/Add_test_for_geo_query_oh

Add test for operation hooks
This commit is contained in:
Amirali Jafarian 2016-10-14 09:36:29 -04:00 committed by GitHub
commit ec204dfa14
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',
function(done) {
monitorHookExecution();