Sha256: 7082327198350cbd6040b153043a4dd669fc7bfb19c5c76039e4c723092de28e

Contents?: true

Size: 1.12 KB

Versions: 20

Compression:

Stored size: 1.12 KB

Contents

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

module Stripe
  class ApplicationFeeRefundTest < Test::Unit::TestCase
    FIXTURE = API_FIXTURES.fetch(:fee_refund)

    setup do
      application_fee_fixture = API_FIXTURES.fetch(:platform_earning)
      @fee = Stripe::ApplicationFee.retrieve(application_fee_fixture[:id])
    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/#{FIXTURE[:id]}"
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
stripe-3.0.3 test/stripe/application_fee_refund_test.rb
stripe-3.0.1 test/stripe/application_fee_refund_test.rb
stripe-3.0.0 test/stripe/application_fee_refund_test.rb
stripe-2.12.0 test/stripe/application_fee_refund_test.rb
stripe-2.11.0 test/stripe/application_fee_refund_test.rb
stripe-2.10.0 test/stripe/application_fee_refund_test.rb
stripe-2.9.0 test/stripe/application_fee_refund_test.rb
stripe-2.8.0 test/stripe/application_fee_refund_test.rb
stripe-2.7.0 test/stripe/application_fee_refund_test.rb
stripe-2.6.0 test/stripe/application_fee_refund_test.rb
stripe-2.5.0 test/stripe/application_fee_refund_test.rb
stripe-2.4.0 test/stripe/application_fee_refund_test.rb
stripe-2.3.0 test/stripe/application_fee_refund_test.rb
stripe-2.2.1 test/stripe/application_fee_refund_test.rb
stripe-2.2.0 test/stripe/application_fee_refund_test.rb
stripe-2.1.0 test/stripe/application_fee_refund_test.rb
stripe-2.0.3 test/stripe/application_fee_refund_test.rb
stripe-2.0.2 test/stripe/application_fee_refund_test.rb
stripe-2.0.1 test/stripe/application_fee_refund_test.rb
stripe-2.0.0 test/stripe/application_fee_refund_test.rb