mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-08-23 00:00:53 -04:00
Unit tests for ApplicationFee.
This commit is contained in:
parent
81e46f4d6c
commit
127e906d60
22
test/stripe/application_fee_test.rb
Normal file
22
test/stripe/application_fee_test.rb
Normal file
@ -0,0 +1,22 @@
|
||||
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(test_response(test_application_fee_array))
|
||||
fees = Stripe::ApplicationFee.all
|
||||
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.returns(test_response({:id => "fee_test_fee", :refunded => true}))
|
||||
fee = Stripe::ApplicationFee.new("test_application_fee")
|
||||
fee.refund
|
||||
assert fee.refunded
|
||||
end
|
||||
end
|
||||
end
|
@ -70,6 +70,29 @@ def test_balance_transaction_array
|
||||
}
|
||||
end
|
||||
|
||||
def test_application_fee(params={})
|
||||
{
|
||||
:refunded => false,
|
||||
:amount => 100,
|
||||
:application => "ca_test_application",
|
||||
:user => "acct_test_user",
|
||||
:charge => "ch_test_charge",
|
||||
:id => "fee_test_fee",
|
||||
:livemode => false,
|
||||
:currency => "usd",
|
||||
:object => "application_fee",
|
||||
:created => 1304114826
|
||||
}.merge(params)
|
||||
end
|
||||
|
||||
def test_application_fee_array
|
||||
{
|
||||
:data => [test_application_fee, test_application_fee, test_application_fee],
|
||||
:object => 'list',
|
||||
:url => '/v1/application_fees'
|
||||
}
|
||||
end
|
||||
|
||||
def test_customer(params={})
|
||||
{
|
||||
:subscription_history => [],
|
||||
|
Loading…
x
Reference in New Issue
Block a user