mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-10-05 00:02:50 -04:00
Follows up the patch in #351, which I now believe is wrong. The trouble is that we were mutating the application fee object, when in reality an application fee refund is actually a completely new resource (see [creating a refund][create-refund]). This patch edits the original attempt to cut a new object and updates tests accordingly. Once again, related to stripe/stripe-php#208. [create-refund]: https://stripe.com/docs/api#create_fee_refund
25 lines
869 B
Ruby
25 lines
869 B
Ruby
require File.expand_path('../../test_helper', __FILE__)
|
|
|
|
module Stripe
|
|
class ApplicationFeeTest < Test::Unit::TestCase
|
|
should "application fees should be listable" do
|
|
@mock.expects(:get).once.returns(make_response(make_application_fee_array))
|
|
fees = Stripe::ApplicationFee.list
|
|
assert fees.data.kind_of? Array
|
|
fees.each do |fee|
|
|
assert fee.kind_of?(Stripe::ApplicationFee)
|
|
end
|
|
end
|
|
|
|
should "application fees should be refundable" do
|
|
@mock.expects(:get).never
|
|
@mock.expects(:post).once.
|
|
with("#{Stripe.api_base}/v1/application_fees/test_application_fee/refunds", nil, '').
|
|
returns(make_response(make_application_fee_refund))
|
|
fee = Stripe::ApplicationFee.new("test_application_fee")
|
|
refund = fee.refund
|
|
assert refund.kind_of?(Stripe::ApplicationFeeRefund)
|
|
end
|
|
end
|
|
end
|