Skip to content

Commit

Permalink
Add ScheduledQueryRun resource
Browse files Browse the repository at this point in the history
  • Loading branch information
remi-stripe committed Jul 27, 2018
1 parent e7d6091 commit 0654718
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/resources/Sigma/ScheduledQueryRun.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

var StripeResource = require('../../StripeResource');

module.exports = StripeResource.extend({
path: 'sigma/scheduled_query_runs',

includeBasic: ['list', 'retrieve'],
});
3 changes: 3 additions & 0 deletions lib/stripe.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ var resources = {
Transactions: require('./resources/Issuing/Transactions'),
Disputes: require('./resources/Issuing/Disputes'),
}),
Sigma: resourceNamespace('sigma', {
ScheduledQueryRuns: require('./resources/Sigma/ScheduledQueryRun'),
}),
};

Stripe.StripeResource = require('./StripeResource');
Expand Down
32 changes: 32 additions & 0 deletions test/resources/Sigma/ScheduledQueryRun.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
'use strict';

var stripe = require('../../testUtils').getSpyableStripe();
var expect = require('chai').expect;

describe('Sigma', function () {
describe('ScheduledQueryRun Resource', function() {
describe('retrieve', function() {
it('Sends the correct request', function() {
stripe.sigma.scheduledQueryRuns.retrieve('sqr_123');
expect(stripe.LAST_REQUEST).to.deep.equal({
method: 'GET',
url: '/v1/sigma/scheduled_query_runs/sqr_123',
data: {},
headers: {},
});
});
});

describe('list', function() {
it('Sends the correct request', function() {
stripe.sigma.scheduledQueryRuns.list();
expect(stripe.LAST_REQUEST).to.deep.equal({
method: 'GET',
url: '/v1/sigma/scheduled_query_runs',
data: {},
headers: {},
});
});
});
});
});

0 comments on commit 0654718

Please sign in to comment.