Merge pull request #668 from stripe/remi-scheduled-run-mock

Move Scheduled Query Run and Source Transaction to stripe-mock
This commit is contained in:
Olivier Bellone 2018-07-31 13:47:12 +02:00 committed by GitHub
commit 704231a4f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 2 additions and 18 deletions

View File

@ -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:

View File

@ -6,9 +6,6 @@ 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)
@ -16,8 +13,6 @@ module Stripe
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)

View File

@ -9,17 +9,6 @@ module Stripe
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"

View File

@ -16,7 +16,7 @@ PROJECT_ROOT = File.expand_path("../../", __FILE__)
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