|
@@ -108,6 +108,7 @@ describe('SubscriptionController', function () {
|
|
|
gaExperiments: {},
|
|
gaExperiments: {},
|
|
|
}
|
|
}
|
|
|
this.GeoIpLookup = {
|
|
this.GeoIpLookup = {
|
|
|
|
|
+ isValidCurrencyParam: sinon.stub().returns(true),
|
|
|
getCurrencyCode: sinon.stub(),
|
|
getCurrencyCode: sinon.stub(),
|
|
|
promises: {
|
|
promises: {
|
|
|
getCurrencyCode: sinon.stub(),
|
|
getCurrencyCode: sinon.stub(),
|
|
@@ -263,6 +264,16 @@ describe('SubscriptionController', function () {
|
|
|
}
|
|
}
|
|
|
this.SubscriptionController.paymentPage(this.req, this.res)
|
|
this.SubscriptionController.paymentPage(this.req, this.res)
|
|
|
})
|
|
})
|
|
|
|
|
+
|
|
|
|
|
+ it('should use the geo ip currency if not valid', function (done) {
|
|
|
|
|
+ this.req.query.currency = 'WAT'
|
|
|
|
|
+ this.GeoIpLookup.isValidCurrencyParam.returns(false)
|
|
|
|
|
+ this.res.render = (page, opts) => {
|
|
|
|
|
+ opts.currency.should.equal(this.stubbedCurrencyCode)
|
|
|
|
|
+ done()
|
|
|
|
|
+ }
|
|
|
|
|
+ this.SubscriptionController.paymentPage(this.req, this.res)
|
|
|
|
|
+ })
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
describe('with a recurly subscription already', function () {
|
|
describe('with a recurly subscription already', function () {
|