mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Test creating two invites at once
This commit is contained in:
parent
5351e79c7a
commit
3cec6affab
1 changed files with 27 additions and 0 deletions
|
@ -249,6 +249,33 @@ describe "ProjectInviteTests", ->
|
|||
(cb) => expectInviteListCount @sendingUser, @projectId, 0, cb
|
||||
], done
|
||||
|
||||
it 'should allow the project owner to many invites at once', (done) ->
|
||||
@inviteOne = null
|
||||
@inviteTwo = null
|
||||
Async.series [
|
||||
(cb) => expectProjectAccess @sendingUser, @projectId, cb
|
||||
(cb) => expectInviteListCount @sendingUser, @projectId, 0, cb
|
||||
# create first invite
|
||||
(cb) => createInvite @sendingUser, @projectId, @email, (err, invite) =>
|
||||
return cb(err) if err
|
||||
@inviteOne = invite
|
||||
cb()
|
||||
(cb) => expectInviteListCount @sendingUser, @projectId, 1, cb
|
||||
# and a second
|
||||
(cb) => createInvite @sendingUser, @projectId, @email, (err, invite) =>
|
||||
return cb(err) if err
|
||||
@inviteTwo = invite
|
||||
cb()
|
||||
# should have two
|
||||
(cb) => expectInviteListCount @sendingUser, @projectId, 2, cb
|
||||
# revoke first
|
||||
(cb) => revokeInvite @sendingUser, @projectId, @inviteOne._id, cb
|
||||
(cb) => expectInviteListCount @sendingUser, @projectId, 1, cb
|
||||
# revoke second
|
||||
(cb) => revokeInvite @sendingUser, @projectId, @inviteTwo._id, cb
|
||||
(cb) => expectInviteListCount @sendingUser, @projectId, 0, cb
|
||||
], done
|
||||
|
||||
describe 'clicking the invite link', ->
|
||||
|
||||
beforeEach (done) ->
|
||||
|
|
Loading…
Reference in a new issue