|
|
@@ -116,6 +116,7 @@ describe "RecurlyWrapper", ->
|
|
|
apiKey: 'nonsense'
|
|
|
privateKey: 'private_nonsense'
|
|
|
|
|
|
+ tk.freeze Date.now() # freeze the time for these tests
|
|
|
@RecurlyWrapper = RecurlyWrapper = SandboxedModule.require modulePath, requires:
|
|
|
"settings-sharelatex": @settings
|
|
|
"logger-sharelatex":
|
|
|
@@ -124,10 +125,11 @@ describe "RecurlyWrapper", ->
|
|
|
log: sinon.stub()
|
|
|
"request": sinon.stub()
|
|
|
|
|
|
- describe "sign", ->
|
|
|
+ after ->
|
|
|
+ tk.reset()
|
|
|
|
|
|
+ describe "sign", ->
|
|
|
before (done) ->
|
|
|
- tk.freeze Date.now() # freeze the time for these tests
|
|
|
@RecurlyWrapper.sign({
|
|
|
subscription :
|
|
|
plan_code : "gold"
|
|
|
@@ -137,9 +139,6 @@ describe "RecurlyWrapper", ->
|
|
|
done()
|
|
|
)
|
|
|
|
|
|
- after ->
|
|
|
- tk.reset()
|
|
|
-
|
|
|
it "should be signed correctly", ->
|
|
|
signed = @signature.split("|")[0]
|
|
|
query = @signature.split("|")[1]
|
|
|
@@ -1061,4 +1060,4 @@ describe "RecurlyWrapper", ->
|
|
|
@RecurlyWrapper.listAccountActiveSubscriptions @user_id, @callback
|
|
|
|
|
|
it "should return an empty array of subscriptions", ->
|
|
|
- @callback.calledWith(null, []).should.equal true
|
|
|
+ @callback.calledWith(null, []).should.equal true
|