mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-30 20:31:34 +02:00
test error case for inviteToProject
This commit is contained in:
@@ -79,3 +79,13 @@ describe "CollaboratorsInviteHandler", ->
|
||||
@CollaboratorsEmailHandler.notifyUserOfProjectInvite.callCount.should.equal 1
|
||||
@CollaboratorsEmailHandler.notifyUserOfProjectInvite.calledWith(@projectId, @email).should.equal true
|
||||
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()
|
||||
|
||||
Reference in New Issue
Block a user