Sha256: 076241f7a2c0d7c57ac4a041b204578cd66981e669a66cc7c0f1b13dd724002a
Contents?: true
Size: 1.25 KB
Versions: 18
Compression:
Stored size: 1.25 KB
Contents
require File.expand_path('../../test_helper', __FILE__) module Stripe class RecipientCardTest < Test::Unit::TestCase FIXTURE = API_FIXTURES.fetch(:source) setup do @recipient = Stripe::Recipient.retrieve(API_FIXTURES.fetch(:transfer_recipient)[:id]) 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: API_FIXTURES.fetch(:token)[:id] ) 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(FIXTURE.merge(recipient: @recipient.id)) card = card.delete assert_requested :delete, "#{Stripe.api_base}/v1/recipients/#{@recipient.id}/cards/#{FIXTURE[:id]}" assert card.kind_of?(Stripe::Card) end should "be saveable" do card = Stripe::Card.construct_from(FIXTURE.merge(recipient: @recipient.id)) card.metadata['key'] = 'value' card.save assert_requested :post, "#{Stripe.api_base}/v1/recipients/#{@recipient.id}/cards/#{FIXTURE[:id]}" end end end
Version data entries
18 entries across 18 versions & 1 rubygems