diff options
author | Ben Burwell <github@benburwell.com> | 2016-01-12 18:27:54 -0500 |
---|---|---|
committer | Ben Burwell <github@benburwell.com> | 2016-01-12 18:27:54 -0500 |
commit | 1afea8fece81d6311b40509bf51a853ae946764c (patch) | |
tree | b1753847741e4919acadc8ea59742a417283c626 /tests | |
parent | 1a4a8c5e8dbb1e2d3b3da87e82cfe734537a503b (diff) | |
parent | ec7575f4dc3c52c7a5bb8b5f482f6a3664abfd2d (diff) |
Merge pull request #4 from benburwell/alert-filteringv1.1.0
Add support for alert_days and alert_minutes parameters
Diffstat (limited to 'tests')
-rw-r--r-- | tests/active911.js | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/tests/active911.js b/tests/active911.js index 0aa9ffa..de91f1c 100644 --- a/tests/active911.js +++ b/tests/active911.js @@ -17,7 +17,7 @@ var resourceResponse = require('./replies/resource.json'); var errorResponse = require('./replies/error.json'); var nockPath = function(path, response) { - nock('https://access.active911.com') + return nock('https://access.active911.com') .get('/interface/open_api/api' + path) .reply(200, response); }; @@ -136,3 +136,26 @@ describe('Active911 API', function() { }); }); }); + +describe('Alert filtering', function() { + it('should request alerts filtered by alert_days', function(done) { + var n = nockPath('/alerts?alert_days=1', alertsResponse); + client.getAlerts({ alert_days: 1}).then(function() { + n.isDone().should.be.true; + done(); + }).catch(function(err) { + false.should.be.true; + done(); + }); + }); + it('should request alerts filtered by alert_minutes', function(done) { + var n = nockPath('/alerts?alert_minutes=1', alertsResponse); + client.getAlerts({ alert_minutes: 1}).then(function() { + n.isDone().should.be.true; + done(); + }).catch(function(err) { + false.should.be.true; + done(); + }); + }); +}); |