Sha256: bb84be6a918cb53854a20c4078171e5e43cf9428e94604ef3d37e401855db313
Contents?: true
Size: 1.31 KB
Versions: 36
Compression:
Stored size: 1.31 KB
Contents
# frozen_string_literal: true require ::File.expand_path("../../test_helper", __FILE__) module Stripe class ReversalTest < Test::Unit::TestCase setup do @transfer = Stripe::Transfer.retrieve("tr_123") end should "be listable" do reversals = @transfer.reversals.list assert_requested :get, "#{Stripe.api_base}/v1/transfers/#{@transfer.id}/reversals" assert reversals.data.is_a?(Array) assert reversals.data[0].is_a?(Stripe::Reversal) end should "be retrievable" do reversal = @transfer.reversals.retrieve("trr_123") assert_requested :get, "#{Stripe.api_base}/v1/transfers/#{@transfer.id}/reversals/trr_123" assert reversal.is_a?(Stripe::Reversal) end should "be creatable" do reversal = @transfer.reversals.create( amount: 100 ) assert_requested :post, "#{Stripe.api_base}/v1/transfers/#{@transfer.id}/reversals" assert reversal.is_a?(Stripe::Reversal) end should "be saveable" do reversal = @transfer.reversals.retrieve("trr_123") reversal.metadata["key"] = "value" reversal.save assert_requested :post, "#{Stripe.api_base}/v1/transfers/#{reversal.transfer}/reversals/#{reversal.id}" end end end
Version data entries
36 entries across 36 versions & 1 rubygems