mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-10-04 00:00:47 -04:00
* chore!: Update CA certifacte bundle (Apr 26). (#1079) * Generate stripe-ruby with breaking changes (#1102) * Generate stripe-ruby with breaking changes * Remove RecipientTest * Remove AlipayAccount tests * Regenerate files * Delete outdated tests * Fix more tests * Fix more tests * Fix example test manually * Update retrieve_cash_balance method to have params. (#1104) Co-authored-by: Dominic Charley-Roy <78050200+dcr-stripe@users.noreply.github.com>
46 lines
1.4 KiB
Ruby
46 lines
1.4 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
require ::File.expand_path("../../test_helper", __dir__)
|
|
|
|
module Stripe
|
|
module Issuing
|
|
class CardTest < Test::Unit::TestCase
|
|
should "be creatable" do
|
|
card = Stripe::Issuing::Card.create(
|
|
currency: "usd",
|
|
type: "physical"
|
|
)
|
|
assert_requested :post, "#{Stripe.api_base}/v1/issuing/cards"
|
|
assert card.is_a?(Stripe::Issuing::Card)
|
|
end
|
|
|
|
should "be listable" do
|
|
cards = Stripe::Issuing::Card.list
|
|
assert_requested :get, "#{Stripe.api_base}/v1/issuing/cards"
|
|
assert cards.data.is_a?(Array)
|
|
assert cards.data[0].is_a?(Stripe::Issuing::Card)
|
|
end
|
|
|
|
should "be retrievable" do
|
|
card = Stripe::Issuing::Card.retrieve("ic_123")
|
|
assert_requested :get, "#{Stripe.api_base}/v1/issuing/cards/ic_123"
|
|
assert card.is_a?(Stripe::Issuing::Card)
|
|
end
|
|
|
|
should "be saveable" do
|
|
card = Stripe::Issuing::Card.retrieve("ic_123")
|
|
card.metadata["key"] = "value"
|
|
card.save
|
|
assert_requested :post, "#{Stripe.api_base}/v1/issuing/cards/ic_123"
|
|
assert card.is_a?(Stripe::Issuing::Card)
|
|
end
|
|
|
|
should "be updateable" do
|
|
card = Stripe::Issuing::Card.update("ic_123", metadata: { foo: "bar" })
|
|
assert_requested :post, "#{Stripe.api_base}/v1/issuing/cards/ic_123"
|
|
assert card.is_a?(Stripe::Issuing::Card)
|
|
end
|
|
end
|
|
end
|
|
end
|