log out when a doc from the project collection is used

This commit is contained in:
Henry Oswald 2015-02-22 18:45:21 +00:00
parent 18a05d8813
commit daf7c4f68e
2 changed files with 2 additions and 1 deletions

View file

@ -16,6 +16,7 @@ module.exports = DocManager =
if docFromDocCollection?
return callback null, docFromDocCollection, mongoPath
else if doc?
logger.warn project_id:project_id, doc_id:doc_id, "doc just used from project collection, why?"
return callback null, doc, mongoPath
else
return callback new Errors.NotFoundError("No such doc: #{project_id}")

View file

@ -11,7 +11,7 @@ describe "DocManager", ->
beforeEach ->
@DocManager = SandboxedModule.require modulePath, requires:
"./MongoManager": @MongoManager = {}
"logger-sharelatex": @logger = {log: sinon.stub()}
"logger-sharelatex": @logger = {log: sinon.stub(), warn:->}
@doc_id = ObjectId().toString()
@project_id = ObjectId().toString()
@callback = sinon.stub()