Sha256: f0f3a09ab33f4986fece53850946b93965a1f74a7163bfee18cb22747d99226e

Contents?: true

Size: 1008 Bytes

Versions: 5

Compression:

Stored size: 1008 Bytes

Contents

require File.expand_path('../../test_helper', __FILE__)

module Stripe
  class ApplicationFeeRefundTest < Test::Unit::TestCase
    setup do
      @fee = Stripe::ApplicationFee.retrieve("fee_123")
    end

    should "be listable" do
      refunds = @fee.refunds

      # notably this *doesn't* make an API call
      assert_not_requested :get,
        "#{Stripe.api_base}/v1/application_fees/#{@fee.id}/refunds"

      assert refunds.data.kind_of?(Array)
      assert refunds.first.kind_of?(Stripe::ApplicationFeeRefund)
    end

    should "be creatable" do
      refund = @fee.refunds.create
      assert_requested :post,
        "#{Stripe.api_base}/v1/application_fees/#{@fee.id}/refunds"
      assert refund.kind_of?(Stripe::ApplicationFeeRefund)
    end

    should "be saveable" do
      refund = @fee.refunds.first
      refund.metadata['key'] = 'value'
      refund.save
      assert_requested :post,
        "#{Stripe.api_base}/v1/application_fees/#{@fee.id}/refunds/#{refund.id}"
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
stripe-3.3.2 test/stripe/application_fee_refund_test.rb
stripe-3.3.1 test/stripe/application_fee_refund_test.rb
stripe-3.3.0 test/stripe/application_fee_refund_test.rb
stripe-3.2.0 test/stripe/application_fee_refund_test.rb
stripe-3.1.0 test/stripe/application_fee_refund_test.rb