|
@@ -25,12 +25,15 @@ describe 'ProjectDeleter', ->
|
|
|
@editorController = notifyUsersProjectHasBeenDeletedOrRenamed : sinon.stub().callsArgWith(1)
|
|
@editorController = notifyUsersProjectHasBeenDeletedOrRenamed : sinon.stub().callsArgWith(1)
|
|
|
@TagsHandler =
|
|
@TagsHandler =
|
|
|
removeProjectFromAllTags: sinon.stub().callsArgWith(2)
|
|
removeProjectFromAllTags: sinon.stub().callsArgWith(2)
|
|
|
|
|
+ @ProjectGetter =
|
|
|
|
|
+ getProject:sinon.stub()
|
|
|
@deleter = SandboxedModule.require modulePath, requires:
|
|
@deleter = SandboxedModule.require modulePath, requires:
|
|
|
"../Editor/EditorController": @editorController
|
|
"../Editor/EditorController": @editorController
|
|
|
'../../models/Project':{Project:@Project}
|
|
'../../models/Project':{Project:@Project}
|
|
|
'../DocumentUpdater/DocumentUpdaterHandler': @documentUpdaterHandler
|
|
'../DocumentUpdater/DocumentUpdaterHandler': @documentUpdaterHandler
|
|
|
"../Tags/TagsHandler":@TagsHandler
|
|
"../Tags/TagsHandler":@TagsHandler
|
|
|
"../FileStore/FileStoreHandler": @FileStoreHandler = {}
|
|
"../FileStore/FileStoreHandler": @FileStoreHandler = {}
|
|
|
|
|
+ "./ProjectGetter": @ProjectGetter
|
|
|
'logger-sharelatex':
|
|
'logger-sharelatex':
|
|
|
log:->
|
|
log:->
|
|
|
|
|
|
|
@@ -89,6 +92,7 @@ describe 'ProjectDeleter', ->
|
|
|
|
|
|
|
|
describe "archiveProject", ->
|
|
describe "archiveProject", ->
|
|
|
beforeEach ->
|
|
beforeEach ->
|
|
|
|
|
+ @ProjectGetter.getProject.callsArgWith(2, null, @project)
|
|
|
@Project.update.callsArgWith(2)
|
|
@Project.update.callsArgWith(2)
|
|
|
|
|
|
|
|
it "should flushProjectToMongoAndDelete in doc updater", (done)->
|
|
it "should flushProjectToMongoAndDelete in doc updater", (done)->
|