Use ProjectGetter, not Project, in ProjectController.loadEditor

This commit is contained in:
James Allen
2016-03-15 14:12:43 +00:00
parent d09705142e
commit fe1f71413e
2 changed files with 3 additions and 6 deletions
@@ -35,8 +35,6 @@ describe "ProjectController", ->
getAllTags: sinon.stub()
@NotificationsHandler =
getUserNotifications: sinon.stub()
@ProjectModel =
findOne: sinon.stub()
@UserModel =
findById: sinon.stub()
@AuthorizationManager =
@@ -51,6 +49,7 @@ describe "ProjectController", ->
indexProjectReferences: sinon.stub()
@ProjectGetter =
findAllUsersProjects: sinon.stub()
getProject: sinon.stub()
@ProjectController = SandboxedModule.require modulePath, requires:
"settings-sharelatex":@settings
"logger-sharelatex":
@@ -64,7 +63,6 @@ describe "ProjectController", ->
"../Subscription/LimitationsManager": @LimitationsManager
"../Tags/TagsHandler":@TagsHandler
"../Notifications/NotificationsHandler":@NotificationsHandler
'../../models/Project': Project:@ProjectModel
"../../models/User":User:@UserModel
"../Authorization/AuthorizationManager":@AuthorizationManager
"../InactiveData/InactiveProjectManager":@InactiveProjectManager
@@ -296,7 +294,7 @@ describe "ProjectController", ->
fontSize:"massive"
theme:"sexy"
email: "bob@bob.com"
@ProjectModel.findOne.callsArgWith 1, null, @project
@ProjectGetter.getProject.callsArgWith 2, null, @project
@UserModel.findById.callsArgWith(1, null, @user)
@SubscriptionLocator.getUsersSubscription.callsArgWith(1, null, {})
@AuthorizationManager.getPrivilegeLevelForProject.callsArgWith 2, null, "owner"