mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Fix test that could never fail
This commit is contained in:
parent
240dc2e319
commit
e9c164dc73
1 changed files with 4 additions and 5 deletions
|
@ -21,7 +21,6 @@ describe "PasswordResetTokenHandler", ->
|
|||
del:sinon.stub()
|
||||
expire:sinon.stub()
|
||||
exec:sinon.stub()
|
||||
@uuid = v4 : -> return @stubbedToken
|
||||
self = @
|
||||
@PasswordResetTokenHandler = SandboxedModule.require modulePath, requires:
|
||||
"redis" :
|
||||
|
@ -31,16 +30,16 @@ describe "PasswordResetTokenHandler", ->
|
|||
|
||||
"settings-sharelatex":@settings
|
||||
"logger-sharelatex": log:->
|
||||
"node-uuid":@uuid
|
||||
"crypto": randomBytes: () => @stubbedToken
|
||||
|
||||
|
||||
describe "getNewToken", ->
|
||||
|
||||
it "should set a new token into redis with a ttl", (done)->
|
||||
@redisMulti.exec.callsArgWith(0)
|
||||
@PasswordResetTokenHandler.getNewToken @user_id, (err, token)=>
|
||||
@redisMulti.set "password_token:#{@stubbedToken}", @user_id
|
||||
@redisMulti.expire "password_token:#{@stubbedToken}", 60 * 60
|
||||
@PasswordResetTokenHandler.getNewToken @user_id, (err, token) =>
|
||||
@redisMulti.set.calledWith("password_token:#{@stubbedToken.toString("hex")}", @user_id).should.equal true
|
||||
@redisMulti.expire.calledWith("password_token:#{@stubbedToken.toString("hex")}", 60 * 60).should.equal true
|
||||
done()
|
||||
|
||||
it "should return if there was an error", (done)->
|
||||
|
|
Loading…
Reference in a new issue