aboutsummaryrefslogtreecommitdiff
path: root/tests/active911.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/active911.js')
-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();
+ });
+ });
+});