mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-01 13:21:37 +02:00
move tk call to before sandboxed module call
This commit is contained in:
@@ -12,6 +12,7 @@ ObjectId = require("mongojs").ObjectId
|
||||
|
||||
describe "AuthenticationController", ->
|
||||
beforeEach ->
|
||||
tk.freeze(Date.now())
|
||||
@AuthenticationController = SandboxedModule.require modulePath, requires:
|
||||
"./AuthenticationManager": @AuthenticationManager = {}
|
||||
"../User/UserGetter" : @UserGetter = {}
|
||||
@@ -39,7 +40,6 @@ describe "AuthenticationController", ->
|
||||
@req = new MockRequest()
|
||||
@res = new MockResponse()
|
||||
@callback = @next = sinon.stub()
|
||||
tk.freeze(Date.now())
|
||||
|
||||
afterEach ->
|
||||
tk.reset()
|
||||
|
||||
@@ -10,6 +10,7 @@ moment = require('moment')
|
||||
|
||||
describe 'RestoreManager', ->
|
||||
beforeEach ->
|
||||
tk.freeze Date.now() # freeze the time for these tests
|
||||
@RestoreManager = SandboxedModule.require modulePath, requires:
|
||||
'../../infrastructure/FileWriter': @FileWriter = {}
|
||||
'../Uploads/FileSystemImportManager': @FileSystemImportManager = {}
|
||||
@@ -22,7 +23,6 @@ describe 'RestoreManager', ->
|
||||
@project_id = 'mock-project-id'
|
||||
@version = 42
|
||||
@callback = sinon.stub()
|
||||
tk.freeze Date.now() # freeze the time for these tests
|
||||
|
||||
afterEach ->
|
||||
tk.reset()
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user