Sha256: 660751156257ee01395e17d926a4ca0635faa5e48cba6268eb9829290010d6c3

Contents?: true

Size: 1.06 KB

Versions: 36

Compression:

Stored size: 1.06 KB

Contents

# frozen_string_literal: true

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.is_a?(Array)
      assert refunds.first.is_a?(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.is_a?(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

36 entries across 36 versions & 1 rubygems

Version Path
stripe-4.18.0 test/stripe/application_fee_refund_test.rb
stripe-4.17.0 test/stripe/application_fee_refund_test.rb
stripe-4.16.0 test/stripe/application_fee_refund_test.rb
stripe-4.15.0 test/stripe/application_fee_refund_test.rb
stripe-4.14.0 test/stripe/application_fee_refund_test.rb
stripe-4.13.0 test/stripe/application_fee_refund_test.rb
stripe-4.12.0 test/stripe/application_fee_refund_test.rb
stripe-4.11.0 test/stripe/application_fee_refund_test.rb
stripe-4.10.0 test/stripe/application_fee_refund_test.rb
stripe-4.9.1 test/stripe/application_fee_refund_test.rb
stripe-4.9.0 test/stripe/application_fee_refund_test.rb
stripe-4.8.1 test/stripe/application_fee_refund_test.rb
stripe-4.8.0 test/stripe/application_fee_refund_test.rb
stripe-4.7.1 test/stripe/application_fee_refund_test.rb
stripe-4.7.0 test/stripe/application_fee_refund_test.rb
stripe-4.6.0 test/stripe/application_fee_refund_test.rb
stripe-4.5.0 test/stripe/application_fee_refund_test.rb
stripe-4.4.1 test/stripe/application_fee_refund_test.rb
stripe-4.4.0 test/stripe/application_fee_refund_test.rb
stripe-4.3.0 test/stripe/application_fee_refund_test.rb