Skip to content

Commit

Permalink
Move Balance History to /v1/balance_transactions and add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
remi-stripe committed Jul 30, 2019
1 parent 382ae0b commit 49f7201
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 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.60.0
- STRIPE_MOCK_VERSION=0.63.0

cache:
directories:
Expand Down
4 changes: 0 additions & 4 deletions lib/stripe/resources/balance_transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,5 @@ class BalanceTransaction < APIResource
extend Stripe::APIOperations::List

OBJECT_NAME = "balance_transaction".freeze

def self.resource_url
"/v1/balance/history"
end
end
end
20 changes: 20 additions & 0 deletions test/stripe/balance_transaction_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# frozen_string_literal: true

require ::File.expand_path("../test_helper", __dir__)

module Stripe
class BalanceTransactionTest < Test::Unit::TestCase
should "be listable" do
balance_transactions = Stripe::BalanceTransaction.list
assert_requested :get, "#{Stripe.api_base}/v1/balance_transactions"
assert balance_transactions.data.is_a?(Array)
assert balance_transactions.first.is_a?(Stripe::BalanceTransaction)
end

should "be retrievable" do
balance_transaction = Stripe::BalanceTransaction.retrieve("txn_123")
assert_requested :get, "#{Stripe.api_base}/v1/balance_transactions/txn_123"
assert balance_transaction.is_a?(Stripe::BalanceTransaction)
end
end
end
2 changes: 1 addition & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
require ::File.expand_path("stripe_mock", __dir__)

# If changing this number, please also change it in `.travis.yml`.
MOCK_MINIMUM_VERSION = "0.60.0".freeze
MOCK_MINIMUM_VERSION = "0.63.0".freeze
MOCK_PORT = Stripe::StripeMock.start

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

0 comments on commit 49f7201

Please sign in to comment.