mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-31 21:01:33 +02:00
Merge branch 'master' of https://github.com/sharelatex/web-sharelatex
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
"lynx": "0.1.1",
|
||||
"marked": "^0.3.3",
|
||||
"method-override": "^2.3.3",
|
||||
"metrics-sharelatex": "git+https://github.com/sharelatex/metrics-sharelatex.git#0966b75a646720781c6accdca15832e675d7d3f2",
|
||||
"metrics-sharelatex": "git+https://github.com/sharelatex/metrics-sharelatex.git#v1.2.0",
|
||||
"mimelib": "0.2.14",
|
||||
"mocha": "1.17.1",
|
||||
"mongojs": "0.18.2",
|
||||
|
||||
@@ -13,6 +13,7 @@ describe "InactiveProjectManager", ->
|
||||
@settings = {}
|
||||
@DocstoreManager =
|
||||
unarchiveProject:sinon.stub()
|
||||
archiveProject:sinon.stub()
|
||||
@ProjectUpdateHandler =
|
||||
markAsActive:sinon.stub()
|
||||
markAsInactive:sinon.stub()
|
||||
@@ -66,20 +67,20 @@ describe "InactiveProjectManager", ->
|
||||
beforeEach ->
|
||||
|
||||
it "should call unarchiveProject and markAsInactive", (done)->
|
||||
@DocstoreManager.unarchiveProject.callsArgWith(1)
|
||||
@DocstoreManager.archiveProject.callsArgWith(1)
|
||||
@ProjectUpdateHandler.markAsInactive.callsArgWith(1)
|
||||
|
||||
@InactiveProjectManager.deactivateProject @project_id, (err)->
|
||||
@DocstoreManager.unarchiveProject.calledWith(@project_id).should.equal true
|
||||
@ProjectUpdateHandler.markAsInactive.callsArgWith(@project_id).should.equal true
|
||||
@InactiveProjectManager.deactivateProject @project_id, (err)=>
|
||||
@DocstoreManager.archiveProject.calledWith(@project_id).should.equal true
|
||||
@ProjectUpdateHandler.markAsInactive.calledWith(@project_id).should.equal true
|
||||
done()
|
||||
|
||||
it "should not call markAsInactive if there was a problem unarchiving", (done)->
|
||||
@DocstoreManager.unarchiveProject.callsArgWith(1, "errorrr")
|
||||
@DocstoreManager.archiveProject.callsArgWith(1, "errorrr")
|
||||
@ProjectUpdateHandler.markAsInactive.callsArgWith(1)
|
||||
|
||||
@InactiveProjectManager.deactivateProject @project_id, (err)->
|
||||
@InactiveProjectManager.deactivateProject @project_id, (err)=>
|
||||
err.should.equal "errorrr"
|
||||
@DocstoreManager.unarchiveProject.calledWith(@project_id).should.equal true
|
||||
@ProjectUpdateHandler.markAsInactive.callsArgWith(@project_id).should.equal false
|
||||
@DocstoreManager.archiveProject.calledWith(@project_id).should.equal true
|
||||
@ProjectUpdateHandler.markAsInactive.calledWith(@project_id).should.equal false
|
||||
done()
|
||||
|
||||
Reference in New Issue
Block a user