mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-06 00:11:24 +00:00
fixed test for logout
This commit is contained in:
parent
b6b30c3d37
commit
e4223c9b5e
1 changed files with 5 additions and 5 deletions
|
@ -32,8 +32,10 @@ describe "UserController", ->
|
|||
"logger-sharelatex": {log:->}
|
||||
|
||||
|
||||
@req = new MockRequest()
|
||||
@res = new MockResponse()
|
||||
@req =
|
||||
session: destroy:->
|
||||
body:{}
|
||||
@res = {}
|
||||
@next = sinon.stub()
|
||||
@user_id = "323123"
|
||||
@req.session.user =
|
||||
|
@ -86,9 +88,7 @@ describe "UserController", ->
|
|||
|
||||
it "should destroy the session", (done)->
|
||||
|
||||
@req.session.destroy = (cb)->
|
||||
if cb?
|
||||
cb()
|
||||
@req.session.destroy = sinon.stub().callsArgWith(0)
|
||||
@res.redirect = (url)=>
|
||||
url.should.equal "/login"
|
||||
@req.session.destroy.called.should.equal true
|
||||
|
|
Loading…
Reference in a new issue