stripe-ruby/test/stripe/application_fee_test.rb
2017-02-14 12:07:18 -08:00

26 lines
874 B
Ruby

require File.expand_path('../../test_helper', __FILE__)
module Stripe
class ApplicationFeeTest < Test::Unit::TestCase
should "application fees should be listable" do
stub_request(:get, "#{Stripe.api_base}/v1/application_fees").
to_return(body: 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
fee = Stripe::ApplicationFee.construct_from(make_application_fee)
stub_request(:post, "#{Stripe.api_base}/v1/application_fees/#{fee.id}/refunds").
to_return(body: make_response(make_application_fee_refund))
refund = fee.refunds.create
assert refund.is_a?(Stripe::ApplicationFeeRefund)
end
end
end