added inactive and reactivate project logic
This commit is contained in:
@@ -3,7 +3,7 @@ chai = require('chai').should()
|
||||
modulePath = "../../../../app/js/Features/Project/ProjectUpdateHandler.js"
|
||||
SandboxedModule = require('sandboxed-module')
|
||||
|
||||
describe 'updating a project', ->
|
||||
describe 'ProjectUpdateHandler', ->
|
||||
|
||||
|
||||
beforeEach ->
|
||||
@@ -22,3 +22,36 @@ describe 'updating a project', ->
|
||||
now = Date.now()+""
|
||||
date.substring(0,5).should.equal now.substring(0,5)
|
||||
done()
|
||||
|
||||
describe "markAsOpened", ->
|
||||
|
||||
it 'should send an update to mongo', (done)->
|
||||
project_id = "project_id"
|
||||
@handler.markAsOpened project_id, (err)=>
|
||||
args = @ProjectModel.update.args[0]
|
||||
args[0]._id.should.equal project_id
|
||||
date = args[1].lastOpened+""
|
||||
now = Date.now()+""
|
||||
date.substring(0,5).should.equal now.substring(0,5)
|
||||
done()
|
||||
|
||||
describe "markAsInactive", ->
|
||||
|
||||
it 'should send an update to mongo', (done)->
|
||||
project_id = "project_id"
|
||||
@handler.markAsInactive project_id, (err)=>
|
||||
args = @ProjectModel.update.args[0]
|
||||
args[0]._id.should.equal project_id
|
||||
args[1].inactive.should.equal true
|
||||
done()
|
||||
|
||||
describe "markAsActive", ->
|
||||
it 'should send an update to mongo', (done)->
|
||||
project_id = "project_id"
|
||||
@handler.markAsActive project_id, (err)=>
|
||||
args = @ProjectModel.update.args[0]
|
||||
args[0]._id.should.equal project_id
|
||||
args[1]["$unset"].inactive.should.equal true
|
||||
done()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user