mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-12-06 00:00:29 -05:00
Usage on a top-level collection:
```
Stripe::Customer.list.auto_paging_each do |customer|
puts customer
end
```
Usage on a subcollection:
``` ruby
customer.invoices.auto_paging_each do |invoice|
puts invoice
end
```
We've also renamed `#all` to `#list` to prevent confusion ("all" implies
that all resources are being returned, and in Stripe's paginated API
this was not the case). An alias has been provided for backward API
compatibility.
Fixes #167.
Replaces #211 and #248.
23 lines
739 B
Ruby
23 lines
739 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.returns(make_response({:id => "fee_test_fee", :refunded => true}))
|
|
fee = Stripe::ApplicationFee.new("test_application_fee")
|
|
fee.refund
|
|
assert fee.refunded
|
|
end
|
|
end
|
|
end
|