Merge pull request #3064 from overleaf/ta-manage-multiple-groups
Allow Users to Manage Multiple Groups GitOrigin-RevId: c918da0114cdd1d679223f69d81159b4c2608874
This commit is contained in:
@@ -23,11 +23,10 @@ describe('mongoose', function() {
|
||||
})
|
||||
|
||||
describe('Subsription', function() {
|
||||
let user, otherUser
|
||||
let user
|
||||
|
||||
beforeEach(async function() {
|
||||
user = await User.create({ email: 'wombat@potato.net' })
|
||||
otherUser = await User.create({ email: 'giraffe@turnip.org' })
|
||||
})
|
||||
|
||||
it('allows the creation of a subscription', async function() {
|
||||
@@ -41,23 +40,5 @@ describe('mongoose', function() {
|
||||
it('does not allow the creation of a subscription without a manager', async function() {
|
||||
await expect(Subscription.create({ admin_id: user._id })).to.be.rejected
|
||||
})
|
||||
|
||||
it('does not allow a user to manage more than one group', async function() {
|
||||
await expect(
|
||||
Subscription.create({ admin_id: user._id, manager_ids: [user._id] })
|
||||
).to.be.fulfilled
|
||||
await expect(
|
||||
Subscription.create({
|
||||
admin_id: otherUser._id,
|
||||
manager_ids: [otherUser._id]
|
||||
})
|
||||
).to.be.fulfilled
|
||||
await expect(
|
||||
Subscription.update(
|
||||
{ admin_id: user._id },
|
||||
{ $push: { manager_ids: otherUser._id } }
|
||||
)
|
||||
).to.be.rejected
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user