mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-10-05 00:02:50 -04:00
Merge pull request #580 from stripe/tmaxwell/remove-outdated-tests
This commit is contained in:
commit
ebeded507d
@ -1,3 +1,8 @@
|
||||
=== 3.4.0 2017-09-20
|
||||
|
||||
* Mark legacy Bitcoin API as deprecated, and remove corresponding tests
|
||||
* Mark recipients API as deprecated, and remove recipient card tests
|
||||
|
||||
=== 3.3.2 2017-09-20
|
||||
|
||||
* Correct minimum required Ruby version in gemspec (it's 2.0.0)
|
||||
|
@ -1,5 +1,7 @@
|
||||
module Stripe
|
||||
class BitcoinReceiver < APIResource
|
||||
# Directly creating or retrieving BitcoinReceivers is deprecated. Please use
|
||||
# the Sources API instead: https://stripe.com/docs/sources/bitcoin
|
||||
extend Stripe::APIOperations::Create
|
||||
include Stripe::APIOperations::Save
|
||||
include Stripe::APIOperations::Delete
|
||||
|
@ -1,5 +1,7 @@
|
||||
module Stripe
|
||||
class BitcoinTransaction < APIResource
|
||||
# Directly retrieving BitcoinTransactions is deprecated. Please use the
|
||||
# Sources API instead: https://stripe.com/docs/sources/bitcoin
|
||||
extend Stripe::APIOperations::List
|
||||
|
||||
OBJECT_NAME = 'bitcoin_transaction'
|
||||
|
@ -1,4 +1,5 @@
|
||||
module Stripe
|
||||
# Recipients objects are deprecated. Please use Stripe Connect instead.
|
||||
class Recipient < APIResource
|
||||
extend Stripe::APIOperations::Create
|
||||
include Stripe::APIOperations::Delete
|
||||
|
@ -1,67 +0,0 @@
|
||||
require File.expand_path('../../test_helper', __FILE__)
|
||||
|
||||
module Stripe
|
||||
class BitcoinReceiverTest < Test::Unit::TestCase
|
||||
should "be listable" do
|
||||
receivers = Stripe::BitcoinReceiver.list
|
||||
assert_requested :get, "#{Stripe.api_base}/v1/bitcoin/receivers"
|
||||
assert receivers.data.kind_of?(Array)
|
||||
assert receivers.first.kind_of?(Stripe::BitcoinReceiver)
|
||||
end
|
||||
|
||||
should "be retrievable" do
|
||||
receiver = Stripe::BitcoinReceiver.retrieve("btcrcv_123")
|
||||
assert_requested :get,
|
||||
"#{Stripe.api_base}/v1/bitcoin/receivers/btcrcv_123"
|
||||
assert receiver.kind_of?(Stripe::BitcoinReceiver)
|
||||
end
|
||||
|
||||
should "be creatable" do
|
||||
receiver = Stripe::BitcoinReceiver.create(amount: 100, currency: "USD")
|
||||
assert_requested :post, "#{Stripe.api_base}/v1/bitcoin/receivers"
|
||||
assert receiver.kind_of?(Stripe::BitcoinReceiver)
|
||||
end
|
||||
|
||||
should "be saveable" do
|
||||
receiver = Stripe::BitcoinReceiver.retrieve("btcrcv_123")
|
||||
receiver.metadata['key'] = 'value'
|
||||
receiver.save
|
||||
assert_requested :post,
|
||||
"#{Stripe.api_base}/v1/bitcoin/receivers/#{receiver.id}"
|
||||
end
|
||||
|
||||
should "be updateable" do
|
||||
receiver = Stripe::BitcoinReceiver.update("btcrcv_123", metadata: { key: 'value' })
|
||||
assert_requested :post,
|
||||
"#{Stripe.api_base}/v1/bitcoin/receivers/btcrcv_123"
|
||||
assert receiver.kind_of?(Stripe::BitcoinReceiver)
|
||||
end
|
||||
|
||||
should "be deletable" do
|
||||
receiver = Stripe::BitcoinReceiver.retrieve("btcrcv_123")
|
||||
receiver = receiver.delete
|
||||
assert_requested :delete,
|
||||
"#{Stripe.api_base}/v1/bitcoin/receivers/#{receiver.id}"
|
||||
assert receiver.kind_of?(Stripe::BitcoinReceiver)
|
||||
end
|
||||
|
||||
context "#resource_url" do
|
||||
should "return a customer URL" do
|
||||
receiver = Stripe::BitcoinReceiver.construct_from(
|
||||
customer: "cus_123",
|
||||
id: "btcrcv_123",
|
||||
)
|
||||
assert_equal "/v1/customers/cus_123/sources/btcrcv_123",
|
||||
receiver.resource_url
|
||||
end
|
||||
|
||||
should "return an absolute URL" do
|
||||
receiver = Stripe::BitcoinReceiver.construct_from(
|
||||
id: "btcrcv_123",
|
||||
)
|
||||
assert_equal "/v1/bitcoin/receivers/btcrcv_123",
|
||||
receiver.resource_url
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -1,19 +0,0 @@
|
||||
require File.expand_path('../../test_helper', __FILE__)
|
||||
|
||||
module Stripe
|
||||
class BitcoinTransactionTest < Test::Unit::TestCase
|
||||
should "be listable" do
|
||||
transactions = Stripe::BitcoinTransaction.list
|
||||
assert_requested :get, "#{Stripe.api_base}/v1/bitcoin/transactions"
|
||||
assert transactions.data.kind_of?(Array)
|
||||
assert transactions.first.kind_of?(Stripe::BitcoinTransaction)
|
||||
end
|
||||
|
||||
should "be retrievable" do
|
||||
transaction = Stripe::BitcoinTransaction.retrieve("btctxn_123")
|
||||
assert_requested :get,
|
||||
"#{Stripe.api_base}/v1/bitcoin/transactions/btctxn_123"
|
||||
assert transaction.kind_of?(Stripe::BitcoinTransaction)
|
||||
end
|
||||
end
|
||||
end
|
@ -1,44 +0,0 @@
|
||||
require File.expand_path('../../test_helper', __FILE__)
|
||||
|
||||
module Stripe
|
||||
class RecipientCardTest < Test::Unit::TestCase
|
||||
setup do
|
||||
@recipient = Stripe::Recipient.retrieve("rp_123")
|
||||
end
|
||||
|
||||
should "be listable" do
|
||||
cards = @recipient.cards.list
|
||||
assert cards.data.kind_of?(Array)
|
||||
assert cards.data[0].kind_of?(Stripe::Card)
|
||||
end
|
||||
|
||||
should "be creatable" do
|
||||
card = @recipient.cards.create(
|
||||
card: "tok_123"
|
||||
)
|
||||
assert_requested :post, "#{Stripe.api_base}/v1/recipients/#{@recipient.id}/cards"
|
||||
assert card.kind_of?(Stripe::Card)
|
||||
end
|
||||
|
||||
should "be deletable" do
|
||||
card = Stripe::Card.construct_from({
|
||||
id: "card_123",
|
||||
recipient: @recipient.id
|
||||
})
|
||||
card = card.delete
|
||||
assert_requested :delete, "#{Stripe.api_base}/v1/recipients/#{@recipient.id}/cards/card_123"
|
||||
assert card.kind_of?(Stripe::Card)
|
||||
end
|
||||
|
||||
should "be saveable" do
|
||||
card = Stripe::Card.construct_from({
|
||||
id: "card_123",
|
||||
metadata: {},
|
||||
recipient: @recipient.id
|
||||
})
|
||||
card.metadata['key'] = 'value'
|
||||
card.save
|
||||
assert_requested :post, "#{Stripe.api_base}/v1/recipients/#{@recipient.id}/cards/card_123"
|
||||
end
|
||||
end
|
||||
end
|
@ -35,7 +35,7 @@ module Stripe
|
||||
reversal.metadata['key'] = 'value'
|
||||
reversal.save
|
||||
assert_requested :post,
|
||||
"#{Stripe.api_base}/v1/transfers/#{@transfer.id}/reversals/#{reversal.id}"
|
||||
"#{Stripe.api_base}/v1/transfers/#{reversal.transfer}/reversals/#{reversal.id}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user