From 97606ddbb066659e4d3bda70ac5bb2df0e199d69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Du=C5=A1an=20Jureti=C4=87?= Date: Tue, 12 Nov 2013 22:55:15 -0300 Subject: [PATCH] fix preen user history test --- tests/algos.mocha.coffee | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/algos.mocha.coffee b/tests/algos.mocha.coffee index 178a0edd55..67212ccd2b 100644 --- a/tests/algos.mocha.coffee +++ b/tests/algos.mocha.coffee @@ -270,10 +270,13 @@ describe 'Cron', -> after.history = {exp: _.cloneDeep(history), todos: _.cloneDeep(history)} after.habits[0].history = _.cloneDeep(history) algos.cron(after) - # console.log after.habits[0].history -# _.each [after.history.exp, after.history.todos, after.habits[0].history], (arr) -> -# expect(arr.length).to.be 15 -# expect(arr).to.eql [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] + + # remove history entries created by cron + after.history.exp.pop() + after.history.todos.pop() + + _.each [after.history.exp, after.history.todos, after.habits[0].history], (arr) -> + expect(_.map(arr, (x)->x.value)).to.eql [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] describe 'Todos', -> it '1 day missed', ->