From 06547183bb3824f70206775896922128988a88ab Mon Sep 17 00:00:00 2001 From: Remi Jannel Date: Fri, 27 Jul 2018 19:45:28 -0400 Subject: [PATCH] Add ScheduledQueryRun resource --- lib/resources/Sigma/ScheduledQueryRun.js | 9 ++++++ lib/stripe.js | 3 ++ .../resources/Sigma/ScheduledQueryRun.spec.js | 32 +++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 lib/resources/Sigma/ScheduledQueryRun.js create mode 100644 test/resources/Sigma/ScheduledQueryRun.spec.js diff --git a/lib/resources/Sigma/ScheduledQueryRun.js b/lib/resources/Sigma/ScheduledQueryRun.js new file mode 100644 index 0000000000..bc80b40040 --- /dev/null +++ b/lib/resources/Sigma/ScheduledQueryRun.js @@ -0,0 +1,9 @@ +'use strict'; + +var StripeResource = require('../../StripeResource'); + +module.exports = StripeResource.extend({ + path: 'sigma/scheduled_query_runs', + + includeBasic: ['list', 'retrieve'], +}); diff --git a/lib/stripe.js b/lib/stripe.js index d5e6debe9b..e05802efcb 100644 --- a/lib/stripe.js +++ b/lib/stripe.js @@ -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'); diff --git a/test/resources/Sigma/ScheduledQueryRun.spec.js b/test/resources/Sigma/ScheduledQueryRun.spec.js new file mode 100644 index 0000000000..33a2d67f65 --- /dev/null +++ b/test/resources/Sigma/ScheduledQueryRun.spec.js @@ -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: {}, + }); + }); + }); + }); +});