Skip to content

Commit 3589913

Browse files
committed
test: fix country code in api request payload
1 parent 2ed6e9a commit 3589913

File tree

1 file changed

+21
-14
lines changed

1 file changed

+21
-14
lines changed

test/test-02-api.js

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -246,13 +246,13 @@ describe('BillingInfo', () => {
246246
last_name: account.last_name,
247247
number: '4000-0000-0000-0077',
248248
month: 1,
249-
year: (new Date()).getFullYear() + 3,
249+
year: new Date().getFullYear() + 3,
250250
verification_value: '111',
251251
address1: '760 Market Street',
252252
address2: 'Suite 500',
253253
city: 'San Francisco',
254254
state: 'CA',
255-
country: 'USA',
255+
country: 'US',
256256
zip: '94102'
257257
}
258258

@@ -271,13 +271,13 @@ describe('BillingInfo', () => {
271271
last_name: account.last_name,
272272
number: '4111-1111-1111-1111',
273273
month: 1,
274-
year: (new Date()).getFullYear() + 3,
274+
year: new Date().getFullYear() + 3,
275275
verification_value: '111',
276276
address1: '760 Market Street',
277277
address2: 'Suite 500',
278278
city: 'San Francisco',
279279
state: 'CA',
280-
country: 'USA',
280+
country: 'US',
281281
zip: '94102'
282282
}
283283

@@ -344,7 +344,7 @@ describe('Subscription', () => {
344344
// address2: 'Suite 500',
345345
// city: 'San Francisco',
346346
// state: 'CA',
347-
// country: 'USA',
347+
// country: 'US',
348348
// zip: '94102'
349349
// }
350350
//
@@ -441,7 +441,9 @@ describe('Subscription', () => {
441441
demand(err).not.exist()
442442
subscription.state.must.equal('active')
443443
subscription.activated_at.must.be.a.date()
444-
subscription.activated_at.getTime().must.equal(subscription.current_period_started_at.getTime())
444+
subscription.activated_at
445+
.getTime()
446+
.must.equal(subscription.current_period_started_at.getTime())
445447
subscription.canceled_at.must.be.a.string()
446448
subscription.expires_at.must.be.a.string()
447449

@@ -455,7 +457,9 @@ describe('Subscription', () => {
455457

456458
subscription.postpone(nextDate, err => {
457459
demand(err).not.exist()
458-
nextDate.getTime().must.equal(subscription.current_period_ends_at.getTime())
460+
nextDate
461+
.getTime()
462+
.must.equal(subscription.current_period_ends_at.getTime())
459463
done()
460464
})
461465
})
@@ -471,8 +475,7 @@ describe('Subscription', () => {
471475
})
472476

473477
describe.skip('Coupons', () => {
474-
let coupon,
475-
couponCode
478+
let coupon, couponCode
476479

477480
it('can create a coupon', done => {
478481
couponCode = uuid.v4()
@@ -654,7 +657,7 @@ describe('Invoices', () => {
654657

655658
describe('refunds', () => {
656659
before(function(done) {
657-
recurly.Invoice().all({state: 'collected'}, (err, invoices) => {
660+
recurly.Invoice().all({ state: 'paid' }, (err, invoices) => {
658661
demand(err).not.exist()
659662
this.invoices = invoices
660663
done()
@@ -671,7 +674,9 @@ describe('Invoices', () => {
671674
})
672675

673676
it('can issue an open amount refund for a specific amount against an invoice', function(done) {
674-
const refundableInvoice = _.find(this.invoices, invoice => _.get(invoice, 'a.refund'))
677+
const refundableInvoice = _.find(this.invoices, invoice =>
678+
_.get(invoice, 'a.refund')
679+
)
675680
debug('invoice to refund', refundableInvoice)
676681
const refundOptions = { amount_in_cents: 5 }
677682

@@ -696,7 +701,9 @@ describe('Invoices', () => {
696701
})
697702

698703
it('can issue an open amount refund for the full amount against an invoice', function(done) {
699-
const refundableInvoice = _.findLast(this.invoices, invoice => _.get(invoice, 'a.refund'))
704+
const refundableInvoice = _.findLast(this.invoices, invoice =>
705+
_.get(invoice, 'a.refund')
706+
)
700707
debug('invoice to refund', refundableInvoice)
701708

702709
const invoice = recurly.Invoice()
@@ -864,13 +871,13 @@ describe('RecurlyError', () => {
864871
last_name: this.account.properties.last_name,
865872
number: '4000-0000-0000-0101',
866873
month: 1,
867-
year: (new Date()).getFullYear() + 3,
874+
year: new Date().getFullYear() + 3,
868875
verification_value: '111',
869876
address1: '760 Market Street',
870877
address2: 'Suite 500',
871878
city: 'San Francisco',
872879
state: 'CA',
873-
country: 'USA',
880+
country: 'US',
874881
zip: '94102'
875882
}
876883

0 commit comments

Comments
 (0)