mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-25 02:00:10 +02:00
Don't call deprecated findPopulatedById in loadEditor
This commit is contained in:
@@ -187,7 +187,7 @@ module.exports = ProjectController =
|
||||
|
||||
async.parallel {
|
||||
project: (cb)->
|
||||
Project.findPopulatedById project_id, cb
|
||||
Project.findOne { _id: project_id }, cb
|
||||
user: (cb)->
|
||||
if user_id == 'openUser'
|
||||
cb null, defaultSettingsForAnonymousUser(user_id)
|
||||
|
||||
@@ -36,7 +36,7 @@ describe "ProjectController", ->
|
||||
@NotificationsHandler =
|
||||
getUserNotifications: sinon.stub()
|
||||
@ProjectModel =
|
||||
findPopulatedById: sinon.stub()
|
||||
findOne: sinon.stub()
|
||||
@UserModel =
|
||||
findById: sinon.stub()
|
||||
@SecurityManager =
|
||||
@@ -295,7 +295,7 @@ describe "ProjectController", ->
|
||||
fontSize:"massive"
|
||||
theme:"sexy"
|
||||
email: "bob@bob.com"
|
||||
@ProjectModel.findPopulatedById.callsArgWith 1, null, @project
|
||||
@ProjectModel.findOne.callsArgWith 1, null, @project
|
||||
@UserModel.findById.callsArgWith(1, null, @user)
|
||||
@SubscriptionLocator.getUsersSubscription.callsArgWith(1, null, {})
|
||||
@SecurityManager.userCanAccessProject.callsArgWith 2, true, "owner"
|
||||
@@ -310,12 +310,6 @@ describe "ProjectController", ->
|
||||
done()
|
||||
@ProjectController.loadEditor @req, @res
|
||||
|
||||
it "should add the project onto the opts", (done)->
|
||||
@res.render = (pageName, opts)=>
|
||||
opts.project.should.equal @project
|
||||
done()
|
||||
@ProjectController.loadEditor @req, @res
|
||||
|
||||
it "should add user", (done)->
|
||||
@res.render = (pageName, opts)=>
|
||||
opts.user.email.should.equal @user.email
|
||||
|
||||
Reference in New Issue
Block a user