Skip to content
This repository has been archived by the owner on Jul 30, 2020. It is now read-only.

Commit

Permalink
Release Candidate 2
Browse files Browse the repository at this point in the history
  • Loading branch information
heuels committed Sep 1, 2016
1 parent f299e82 commit 0e685f2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Компонент управления поливом.
*
* @author Егор Зайцев <ezaitsev@briskhome.com>
* @version 0.3.0-rc.1
* @version 0.3.0-rc.2
*/

'use strict';
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "briskhome-irrigation",
"version": "0.3.0-rc.1",
"version": "0.3.0-rc.2",
"main": "index.js",
"author": "Egor Zaitsev <ezaitsev@briskhome.com>",
"private": true,
Expand Down
19 changes: 15 additions & 4 deletions specs/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Юнит-тесты для компонента управления поливом.
*
* @author Егор Зайцев <ezaitsev@briskhome.com>
* @version 0.3.0-rc.1
* @version 0.3.0-rc.2
*/


Expand Down Expand Up @@ -974,6 +974,7 @@ describe('Irrigation', function () {
const plannerSaveStub = sinon.stub();
plannerCreateStub.returns({
repeatEvery: () => {},
computeNextRunAt: () => {},
save: plannerSaveStub.yields(new Error('Не удалось сохранить расписание')),
});
irrigation.schedule(stubs.circuits.registered[0]._id,
Expand All @@ -996,6 +997,7 @@ describe('Irrigation', function () {
plannerSaveStub.onCall(1).yields(new Error('Не удалось сохранить расписание'));
plannerCreateStub.returns({
repeatEvery: () => {},
computeNextRunAt: () => {},
save: plannerSaveStub,
});

Expand All @@ -1019,6 +1021,7 @@ describe('Irrigation', function () {
plannerSaveStub.onCall(1).yields(new Error('Не удалось сохранить расписание'));
plannerCreateStub.returns({
repeatEvery: () => {},
computeNextRunAt: () => {},
save: plannerSaveStub,
});

Expand All @@ -1036,11 +1039,15 @@ describe('Irrigation', function () {
});
});

it('should register a timetable', function (done) {
it('should return error if unable to register a timetable', function (done) {
const circuitSaveStub = sinon.stub(Circuit.prototype, 'save');
const plannerSaveStub = sinon.stub();
circuitSaveStub.yields(new Error('MongoError'));
plannerCreateStub.returns({ repeatEvery: () => {}, save: plannerSaveStub.yields(null) });
plannerCreateStub.returns({
repeatEvery: () => {},
computeNextRunAt: () => {},
save: plannerSaveStub.yields(null),
});
irrigation.schedule(stubs.circuits.registered[0]._id,
stubs.timetables[0],
(err) => {
Expand All @@ -1054,7 +1061,11 @@ describe('Irrigation', function () {

it('should register a timetable', function (done) {
const plannerSaveStub = sinon.stub();
plannerCreateStub.returns({ repeatEvery: () => {}, save: plannerSaveStub.yields(null) });
plannerCreateStub.returns({
repeatEvery: () => {},
computeNextRunAt: () => {},
save: plannerSaveStub.yields(null),
});
irrigation.schedule(stubs.circuits.registered[0]._id,
stubs.timetables[0],
(err) => {
Expand Down

0 comments on commit 0e685f2

Please sign in to comment.