mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Fix unit tests
This commit is contained in:
parent
bfa0e7cf89
commit
a373868862
2 changed files with 5 additions and 5 deletions
|
@ -92,7 +92,7 @@ describe "AuthenticationController", ->
|
|||
@req.login = sinon.stub().callsArgWith(1, null)
|
||||
@res.json = sinon.stub()
|
||||
@req.session = @session = {passport: {user: @user}}
|
||||
@req.session.destroy = sinon.stub()
|
||||
@req.session.destroy = sinon.stub().callsArgWith(0, null)
|
||||
@req.session.save = sinon.stub().callsArgWith(0, null)
|
||||
@req.sessionStore = {generate: sinon.stub()}
|
||||
@passport.authenticate.callsArgWith(1, null, @user, @info)
|
||||
|
@ -164,7 +164,7 @@ describe "AuthenticationController", ->
|
|||
@req.session = @session = {passport: {user: @user}}
|
||||
@req.session =
|
||||
passport: {user: {_id: "one"}}
|
||||
@req.session.destroy = sinon.stub()
|
||||
@req.session.destroy = sinon.stub().callsArgWith(0, null)
|
||||
@req.session.save = sinon.stub().callsArgWith(0, null)
|
||||
@req.sessionStore = {generate: sinon.stub()}
|
||||
@UserSessionsManager.trackSession = sinon.stub()
|
||||
|
|
|
@ -33,7 +33,7 @@ describe 'UserSessionsManager', ->
|
|||
@rclient.exec.callsArgWith(0, null)
|
||||
|
||||
@redis =
|
||||
createClient: () => @rclient
|
||||
client: () => @rclient
|
||||
@logger =
|
||||
err: sinon.stub()
|
||||
error: sinon.stub()
|
||||
|
@ -42,15 +42,15 @@ describe 'UserSessionsManager', ->
|
|||
redis:
|
||||
web: {}
|
||||
@UserSessionsManager = SandboxedModule.require modulePath, requires:
|
||||
"redis-sharelatex": @redis
|
||||
"logger-sharelatex": @logger
|
||||
"settings-sharelatex": @settings
|
||||
'./UserSessionsRedis': @redis
|
||||
|
||||
describe '_sessionSetKey', ->
|
||||
|
||||
it 'should build the correct key', ->
|
||||
result = @UserSessionsManager._sessionSetKey(@user)
|
||||
result.should.equal 'UserSessions:abcd'
|
||||
result.should.equal 'UserSessions:{abcd}'
|
||||
|
||||
describe '_sessionKey', ->
|
||||
|
||||
|
|
Loading…
Reference in a new issue