Skip to content

Commit

Permalink
Merge pull request #933 from stripe/remi-fix-price-test
Browse files Browse the repository at this point in the history
Fix tests for `Plan` and `Price` to not appear as amount can be updated.
  • Loading branch information
remi-stripe authored Jun 28, 2020
2 parents 0f2a1d4 + e8adb98 commit c76e402
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
17 changes: 8 additions & 9 deletions test/resources/Plans.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ const expect = require('chai').expect;
describe('Plans Resource', () => {
describe('retrieve', () => {
it('Sends the correct request', () => {
stripe.plans.retrieve('planId1');
stripe.plans.retrieve('plan_123');
expect(stripe.LAST_REQUEST).to.deep.equal({
method: 'GET',
url: '/v1/plans/planId1',
url: '/v1/plans/plan_123',
headers: {},
data: {},
settings: {},
Expand Down Expand Up @@ -96,26 +96,25 @@ describe('Plans Resource', () => {

describe('update', () => {
it('Sends the correct request', () => {
stripe.plans.update('planId3', {
amount: 1900,
currency: 'usd',
stripe.plans.update('plan_123', {
active: false,
});
expect(stripe.LAST_REQUEST).to.deep.equal({
method: 'POST',
url: '/v1/plans/planId3',
url: '/v1/plans/plan_123',
headers: {},
data: {amount: 1900, currency: 'usd'},
data: {active: false},
settings: {},
});
});
});

describe('del', () => {
it('Sends the correct request', () => {
stripe.plans.del('planId4');
stripe.plans.del('plan_123');
expect(stripe.LAST_REQUEST).to.deep.equal({
method: 'DELETE',
url: '/v1/plans/planId4',
url: '/v1/plans/plan_123',
headers: {},
data: {},
settings: {},
Expand Down
9 changes: 4 additions & 5 deletions test/resources/Prices.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,14 @@ describe('Plans Resource', () => {

describe('update', () => {
it('Sends the correct request', () => {
stripe.prices.update('priceId3', {
amount: 1900,
currency: 'usd',
stripe.prices.update('price_123', {
active: false,
});
expect(stripe.LAST_REQUEST).to.deep.equal({
method: 'POST',
url: '/v1/prices/priceId3',
url: '/v1/prices/price_123',
headers: {},
data: {amount: 1900, currency: 'usd'},
data: {active: false},
settings: {},
});
});
Expand Down

0 comments on commit c76e402

Please sign in to comment.