From bec0063d079a9a7c5031c285bdccb58bc8ae1064 Mon Sep 17 00:00:00 2001 From: Remi Jannel Date: Tue, 31 Jul 2018 07:39:25 -0400 Subject: [PATCH] Move Scheduled Query Run and Source Transaction to stripe-mock --- .travis.yml | 2 +- test/stripe/sigma/scheduled_query_run_test.rb | 5 ----- test/stripe/source_transaction_test.rb | 11 ----------- test/test_helper.rb | 2 +- 4 files changed, 2 insertions(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index e532c5b2f..ccf40786d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: diff --git a/test/stripe/sigma/scheduled_query_run_test.rb b/test/stripe/sigma/scheduled_query_run_test.rb index c3044ba1b..aa936a80c 100644 --- a/test/stripe/sigma/scheduled_query_run_test.rb +++ b/test/stripe/sigma/scheduled_query_run_test.rb @@ -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 @@ class ScheduledQueryRunTest < Test::Unit::TestCase 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) diff --git a/test/stripe/source_transaction_test.rb b/test/stripe/source_transaction_test.rb index f7322cb66..d72a69f38 100644 --- a/test/stripe/source_transaction_test.rb +++ b/test/stripe/source_transaction_test.rb @@ -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" diff --git a/test/test_helper.rb b/test/test_helper.rb index d608f5ff6..21cbfbbfc 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -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