Browse Source

Fix tests for UserInfoController.

Shane Kilkelly 10 years ago
parent
commit
7f24dd6f55

+ 2 - 0
services/web/test/UnitTests/coffee/User/UserInfoControllerTests.coffee

@@ -27,6 +27,7 @@ describe "UserInfoController", ->
 			"./UserDeleter": @UserDeleter
 			"logger-sharelatex": log:->
 			"sanitizer":@sanitizer
+			'../Authentication/AuthenticationController': @AuthenticationController = {getLoggedInUserId: sinon.stub()}
 
 		@req = new MockRequest()
 		@res = new MockResponse()
@@ -40,6 +41,7 @@ describe "UserInfoController", ->
 			@req.session.user = @user
 			@UserInfoController.sendFormattedPersonalInfo = sinon.stub()
 			@UserGetter.getUser = sinon.stub().callsArgWith(2, null, @user)
+			@AuthenticationController.getLoggedInUserId = sinon.stub().returns(@user._id)
 			@UserInfoController.getLoggedInUsersPersonalInfo(@req, @res, @next)
 
 		it "should call sendFormattedPersonalInfo", ->