Skip to content

Commit

Permalink
Merge pull request #482 from stripe/remi-add-sigma-scheduled-query-run
Browse files Browse the repository at this point in the history
Add ScheduledQueryRun resource
  • Loading branch information
brandur-stripe authored Jul 28, 2018
2 parents e7d6091 + d28a1ca commit 0849875
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/ScheduledQueryRuns.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/ScheduledQueryRuns'),
}),
};

Stripe.StripeResource = require('./StripeResource');
Expand Down
32 changes: 32 additions & 0 deletions test/resources/Sigma/ScheduledQueryRuns.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 0849875

Please sign in to comment.