Skip to content

Commit

Permalink
Move Scheduled Query Run and Source Transaction to stripe-mock
Browse files Browse the repository at this point in the history
  • Loading branch information
remi-stripe committed Jul 31, 2018
1 parent 4916ead commit bec0063
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ sudo: false
env:
global:
# If changing this number, please also change it in `test/test_helper.rb`.
- STRIPE_MOCK_VERSION=0.23.0
- STRIPE_MOCK_VERSION=0.24.1

cache:
directories:
Expand Down
5 changes: 0 additions & 5 deletions test/stripe/sigma/scheduled_query_run_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,13 @@ 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)
Expand Down
11 changes: 0 additions & 11 deletions test/stripe/source_transaction_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,6 @@ class SourceTransactionTest < Test::Unit::TestCase
end

should "be listable" do
# TODO: remove the stub once stripe-mock supports /v1/sources/src_.../source_transactions
stub_request(:get, "#{Stripe.api_base}/v1/sources/#{@source.id}/source_transactions")
.to_return(body: JSON.generate(
object: "list",
data: [
{
object: "source_transaction",
},
]
))

transactions = @source.source_transactions

assert_requested :get, "#{Stripe.api_base}/v1/sources/#{@source.id}/source_transactions"
Expand Down
2 changes: 1 addition & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
require File.expand_path("../test_data", __FILE__)

# If changing this number, please also change it in `.travis.yml`.
MOCK_MINIMUM_VERSION = "0.23.0".freeze
MOCK_MINIMUM_VERSION = "0.24.1".freeze
MOCK_PORT = ENV["STRIPE_MOCK_PORT"] || 12_111

# Disable all real network connections except those that are outgoing to
Expand Down

0 comments on commit bec0063

Please sign in to comment.