idendifyUser on login
This commit is contained in:
@@ -254,6 +254,8 @@ describe "AuthenticationController", ->
|
||||
@cb = sinon.stub()
|
||||
@LoginRateLimiter.processLoginRequest.callsArgWith(1, null, true)
|
||||
@AuthenticationManager.authenticate = sinon.stub().callsArgWith(2, null, @user)
|
||||
@req.sessionID = Math.random()
|
||||
@AnalyticsManager.idendifyUser = sinon.stub()
|
||||
@AuthenticationController.doPassportLogin(@req, @req.body.email, @req.body.password, @cb)
|
||||
|
||||
it "should attempt to authorise the user", ->
|
||||
@@ -261,6 +263,9 @@ describe "AuthenticationController", ->
|
||||
.calledWith(email: @email.toLowerCase(), @password)
|
||||
.should.equal true
|
||||
|
||||
it "should call idendifyUser", ->
|
||||
@AnalyticsManager.idendifyUser.calledWith(@user._id, @req.sessionID).should.equal true
|
||||
|
||||
it "should setup the user data in the background", ->
|
||||
@UserHandler.setupLoginData.calledWith(@user).should.equal true
|
||||
|
||||
|
||||
Reference in New Issue
Block a user