mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #2651 from overleaf/ta-missing-return
Add Missing Return GitOrigin-RevId: aeb622a6745678eb687217beeb49b5d023168052
This commit is contained in:
parent
818d19bd69
commit
6379f15815
2 changed files with 13 additions and 1 deletions
|
@ -206,7 +206,7 @@ module.exports = SubscriptionController = {
|
|||
}
|
||||
if (hasSubscription) {
|
||||
logger.warn({ user_id: user._id }, 'user already has subscription')
|
||||
res.sendStatus(409) // conflict
|
||||
return res.sendStatus(409) // conflict
|
||||
}
|
||||
return SubscriptionHandler.createSubscription(
|
||||
user,
|
||||
|
|
|
@ -419,6 +419,18 @@ describe('SubscriptionController', function() {
|
|||
})
|
||||
|
||||
describe('createSubscription with errors', function() {
|
||||
it('should handle users with subscription', function(done) {
|
||||
this.LimitationsManager.userHasV1OrV2Subscription.yields(null, true)
|
||||
this.SubscriptionController.createSubscription(this.req, {
|
||||
sendStatus: status => {
|
||||
expect(status).to.equal(409)
|
||||
this.SubscriptionHandler.createSubscription.called.should.equal(false)
|
||||
|
||||
done()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
it('should handle 3DSecure errors', function(done) {
|
||||
this.next = sinon.stub()
|
||||
this.LimitationsManager.userHasV1OrV2Subscription.yields(null, false)
|
||||
|
|
Loading…
Reference in a new issue