From f5e9b532896dd1c1c4f4157466a0d600681e9182 Mon Sep 17 00:00:00 2001 From: Amir Jafarian Date: Tue, 4 Oct 2016 16:50:48 -0400 Subject: [PATCH] Add test for operation hooks * Add test for operation hook when near filter is used --- test/persistence-hooks.suite.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/persistence-hooks.suite.js b/test/persistence-hooks.suite.js index ab7158bd..dab7ff57 100644 --- a/test/persistence-hooks.suite.js +++ b/test/persistence-hooks.suite.js @@ -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();