From cc9c8fdc94293783dfdce50db20d189bf422ab45 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Tue, 19 May 2015 14:59:09 +0100 Subject: [PATCH] freeze Date in Recurly tests before all calls beforeEach freezes and resets for each subtest, which does not give the desired result as the time increases between each subtest, we want to freeze once at the beginning and reset at the end using before/after. --- .../coffee/Subscription/RecurlyWrapperTests.coffee | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/services/web/test/UnitTests/coffee/Subscription/RecurlyWrapperTests.coffee b/services/web/test/UnitTests/coffee/Subscription/RecurlyWrapperTests.coffee index 34cb179f25..e05040772d 100644 --- a/services/web/test/UnitTests/coffee/Subscription/RecurlyWrapperTests.coffee +++ b/services/web/test/UnitTests/coffee/Subscription/RecurlyWrapperTests.coffee @@ -108,13 +108,10 @@ describe "RecurlyWrapper", -> Settings.defaultPlanCode = collaborators: 0 versioning: false - tk.freeze(Date.now()) - - afterEach -> - tk.reset() - + describe "sign", -> before (done) -> + tk.freeze Date.now() # freeze the time for these tests RecurlyWrapper.sign({ subscription : plan_code : "gold" @@ -124,6 +121,9 @@ describe "RecurlyWrapper", -> done() ) + after -> + tk.reset() + it "should be signed correctly", -> signed = @signature.split("|")[0] query = @signature.split("|")[1]