forked from stripe/stripe-ruby
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ec5c51c
commit 4c39c35
Showing
6 changed files
with
97 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# frozen_string_literal: true | ||
|
||
module Stripe | ||
module Sigma | ||
class ScheduledQueryRun < Stripe::APIResource | ||
extend Stripe::APIOperations::List | ||
|
||
OBJECT_NAME = "scheduled_query_run".freeze | ||
|
||
def self.resource_url | ||
"/v1/sigma/scheduled_query_runs" | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# frozen_string_literal: true | ||
|
||
require File.expand_path("../../../test_helper", __FILE__) | ||
|
||
module Stripe | ||
module Issuing | ||
class ScheduledQueryRunTest < Test::Unit::TestCase | ||
should "be listable" do | ||
stub_request(:get, "#{Stripe.api_base}/v1/sigma/scheduled_query_runs") | ||
.to_return(body: JSON.generate(object: "list", data: [{ id: "sqr_123", object: "scheduled_query_run" }])) | ||
|
||
runs = Stripe::Sigma::ScheduledQueryRun.list | ||
assert_requested :get, "#{Stripe.api_base}/v1/sigma/scheduled_query_runs" | ||
assert runs.data.is_a?(Array) | ||
assert runs.data[0].is_a?(Stripe::Sigma::ScheduledQueryRun) | ||
end | ||
|
||
should "be retrievable" do | ||
stub_request(:get, "#{Stripe.api_base}/v1/sigma/scheduled_query_runs/sqr_123") | ||
.to_return(body: JSON.generate(id: "sqr_123", object: "scheduled_query_run")) | ||
run = Stripe::Sigma::ScheduledQueryRun.retrieve("sqr_123") | ||
assert_requested :get, "#{Stripe.api_base}/v1/sigma/scheduled_query_runs/sqr_123" | ||
assert run.is_a?(Stripe::Sigma::ScheduledQueryRun) | ||
end | ||
end | ||
end | ||
end |