Skip to content

Commit

Permalink
Add spec for interval.check.
Browse files Browse the repository at this point in the history
  • Loading branch information
mauricioschneider committed Mar 11, 2015
1 parent f0bdbdd commit 5f06463
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions lib/agent/plugins/control-panel/interval/test/interval_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,31 @@ describe('interval', function () {

});

describe('on check', function() {

var api_stub = {};

before(function () {
interval.unload();
api_stub = sinon.stub(api.devices.get, 'commands', function (cb) {
return true;
});
});

it('triggers a request', function(done) {

load_module(function (err, emitter) {

interval.check();
api_stub.calledOnce.should.equal(true);
done();

});

});

});

describe('on unload', function (){

before(function () {
Expand Down

0 comments on commit 5f06463

Please sign in to comment.