Merge pull request #13934 from overleaf/tm-block-subscriptions-restricted-countries

Block web sales to restricted countries

GitOrigin-RevId: 47c0ac1d5dc387369bbadb67f5822d7fc6637d98
This commit is contained in:
Tim Down
2023-07-25 08:03:59 +00:00
committed by Copybot
parent f2b5ac23f8
commit 3aa0fcf464
5 changed files with 46 additions and 6 deletions
@@ -393,6 +393,27 @@ describe('SubscriptionController', function () {
this.SubscriptionController.paymentPage(this.req, this.res)
})
})
describe('with a user from a restricted country', function () {
beforeEach(function () {
this.LimitationsManager.promises.userHasV1OrV2Subscription.resolves(
false
)
this.PlansLocator.findLocalPlanInSettings.returns({})
this.GeoIpLookup.promises.getCurrencyCode.resolves({
currencyCode: this.stubbedCurrencyCode,
countryCode: 'KP',
})
})
it('should render the restricted country page', function (done) {
this.res.render = (page, opts) => {
page.should.equal('subscriptions/restricted-country')
done()
}
this.SubscriptionController.paymentPage(this.req, this.res, done)
})
})
})
describe('successfulSubscription', function () {