Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move Scheduled Query Run and Source Transaction to stripe-mock #668

Merged
merged 1 commit into from
Jul 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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