mirror of
https://github.com/overleaf/overleaf.git
synced 2025-03-03 16:42:00 +00:00
test error case for inviteToProject
This commit is contained in:
parent
f866bd03bc
commit
c9cfcddbe9
1 changed files with 10 additions and 0 deletions
|
@ -79,3 +79,13 @@ describe "CollaboratorsInviteHandler", ->
|
||||||
@CollaboratorsEmailHandler.notifyUserOfProjectInvite.callCount.should.equal 1
|
@CollaboratorsEmailHandler.notifyUserOfProjectInvite.callCount.should.equal 1
|
||||||
@CollaboratorsEmailHandler.notifyUserOfProjectInvite.calledWith(@projectId, @email).should.equal true
|
@CollaboratorsEmailHandler.notifyUserOfProjectInvite.calledWith(@projectId, @email).should.equal true
|
||||||
done()
|
done()
|
||||||
|
|
||||||
|
describe 'when saving model produces an error', ->
|
||||||
|
|
||||||
|
beforeEach ->
|
||||||
|
@ProjectInvite::save = sinon.spy (cb) -> cb(new Error('woops'), this)
|
||||||
|
|
||||||
|
it 'should produce an error', (done) ->
|
||||||
|
@call (err, invite) =>
|
||||||
|
expect(err).to.be.instanceof Error
|
||||||
|
done()
|
||||||
|
|
Loading…
Reference in a new issue