aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBen Burwell <ben@benburwell.com>2016-01-12 18:17:30 -0500
committerBen Burwell <ben@benburwell.com>2016-01-12 18:17:30 -0500
commitec7575f4dc3c52c7a5bb8b5f482f6a3664abfd2d (patch)
treeb1753847741e4919acadc8ea59742a417283c626 /tests
parent1a4a8c5e8dbb1e2d3b3da87e82cfe734537a503b (diff)
Add support for alert_days and alert_minutes parameters
Diffstat (limited to 'tests')
-rw-r--r--tests/active911.js25
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();
+ });
+ });
+});