From d5b233106c4c0c187aed1c80c15f96eec784ab5a Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Mon, 24 Sep 2012 19:03:26 -0400 Subject: [PATCH] second trial in habit test --- test/user.mocha.coffee | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/test/user.mocha.coffee b/test/user.mocha.coffee index dfa6ac661e..861e77b718 100644 --- a/test/user.mocha.coffee +++ b/test/user.mocha.coffee @@ -104,7 +104,17 @@ describe 'User', -> expect(statsAfter.hp).to.eql statsBefore.hp # Task should have lost value expect(taskBefore.value).to.eql 0 - expect(taskAfter.value).to.be.lessThan 1 + expect(taskAfter.value).to.be.greaterThan taskBefore.value + + ## Trial 2 + taskBefore = pathSnapshots(taskPath) + scoring.score(uuid, 'up') + taskAfter = pathSnapshots(taskPath) + # Should have lost in value + expect(taskAfter.value).to.be > taskBefore.value + # And lost more than trial 1 + diff = Math.abs(taskAfter.value) - Math.abs(taskBefore.value) + expect(diff).to.be.lessThan 1 it 'makes history entry for habit' it 'makes proper modifications each time when clicking + / - in rapid succession'