From 882853415b96e5623eac01f70d9ca5efbc2b3854 Mon Sep 17 00:00:00 2001 From: Steven Fuchs Date: Thu, 2 Feb 2012 11:26:58 -0500 Subject: [PATCH] commit test for new code that keeps count from going negative. --- spec/javascripts/widgets/notifications-spec.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spec/javascripts/widgets/notifications-spec.js b/spec/javascripts/widgets/notifications-spec.js index 6f5e84dce..787154d4b 100644 --- a/spec/javascripts/widgets/notifications-spec.js +++ b/spec/javascripts/widgets/notifications-spec.js @@ -46,7 +46,16 @@ describe("Diaspora.Widgets.Notifications", function() { }); describe("decrementCount", function() { + it("wont decrement Notifications.count below zero", function() { + var originalCount = notifications.count; + notifications.decrementCount(); + expect(originalCount).toEqual(0); + expect(notifications.count).toEqual(0); + }); + it("decrements Notifications.count", function() { + notifications.incrementCount(); + notifications.incrementCount(); var originalCount = notifications.count; notifications.decrementCount(); expect(notifications.count).toBeLessThan(originalCount);