Fix unit test

This commit is contained in:
Shane Kilkelly 2017-09-21 15:01:40 +01:00
parent abe41b6948
commit 562b2db600

View file

@ -30,7 +30,10 @@ describe "CollaboratorsHandler", ->
describe "with project", -> describe "with project", ->
beforeEach -> beforeEach ->
@Project.findOne = sinon.stub() @Project.findOne = sinon.stub()
@Project.findOne.withArgs({_id: @project_id}, {owner_ref: 1, collaberator_refs: 1, readOnly_refs: 1}).yields(null, @project = { @Project.findOne.withArgs(
{_id: @project_id},
{owner_ref: 1, collaberator_refs: 1, readOnly_refs: 1, tokenAccessReadOnly_refs: 1, tokenAccessReadAndWrite_refs: 1}
).yields(null, @project = {
owner_ref: [ "owner-ref" ] owner_ref: [ "owner-ref" ]
readOnly_refs: [ "read-only-ref-1", "read-only-ref-2" ] readOnly_refs: [ "read-only-ref-1", "read-only-ref-2" ]
collaberator_refs: [ "read-write-ref-1", "read-write-ref-2" ] collaberator_refs: [ "read-write-ref-1", "read-write-ref-2" ]