|
@@ -13,6 +13,7 @@ describe "InactiveProjectManager", ->
|
|
|
@settings = {}
|
|
@settings = {}
|
|
|
@DocstoreManager =
|
|
@DocstoreManager =
|
|
|
unarchiveProject:sinon.stub()
|
|
unarchiveProject:sinon.stub()
|
|
|
|
|
+ archiveProject:sinon.stub()
|
|
|
@ProjectUpdateHandler =
|
|
@ProjectUpdateHandler =
|
|
|
markAsActive:sinon.stub()
|
|
markAsActive:sinon.stub()
|
|
|
markAsInactive:sinon.stub()
|
|
markAsInactive:sinon.stub()
|
|
@@ -66,20 +67,20 @@ describe "InactiveProjectManager", ->
|
|
|
beforeEach ->
|
|
beforeEach ->
|
|
|
|
|
|
|
|
it "should call unarchiveProject and markAsInactive", (done)->
|
|
it "should call unarchiveProject and markAsInactive", (done)->
|
|
|
- @DocstoreManager.unarchiveProject.callsArgWith(1)
|
|
|
|
|
|
|
+ @DocstoreManager.archiveProject.callsArgWith(1)
|
|
|
@ProjectUpdateHandler.markAsInactive.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()
|
|
done()
|
|
|
|
|
|
|
|
it "should not call markAsInactive if there was a problem unarchiving", (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)
|
|
@ProjectUpdateHandler.markAsInactive.callsArgWith(1)
|
|
|
|
|
|
|
|
- @InactiveProjectManager.deactivateProject @project_id, (err)->
|
|
|
|
|
|
|
+ @InactiveProjectManager.deactivateProject @project_id, (err)=>
|
|
|
err.should.equal "errorrr"
|
|
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()
|
|
done()
|