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.2.0 test/stripe/application_fee_refund_test.rb
stripe-4.1.0 test/stripe/application_fee_refund_test.rb
stripe-4.0.3 test/stripe/application_fee_refund_test.rb
stripe-4.0.2 test/stripe/application_fee_refund_test.rb
stripe-4.0.1 test/stripe/application_fee_refund_test.rb
stripe-4.0.0 test/stripe/application_fee_refund_test.rb
stripe-3.31.1 test/stripe/application_fee_refund_test.rb
stripe-3.31.0 test/stripe/application_fee_refund_test.rb
stripe-3.30.0 test/stripe/application_fee_refund_test.rb
stripe-3.29.0 test/stripe/application_fee_refund_test.rb
stripe-3.28.0 test/stripe/application_fee_refund_test.rb
stripe-3.27.0 test/stripe/application_fee_refund_test.rb
stripe-3.26.1 test/stripe/application_fee_refund_test.rb
stripe-3.26.0 test/stripe/application_fee_refund_test.rb
stripe-3.25.0 test/stripe/application_fee_refund_test.rb
stripe-3.24.0 test/stripe/application_fee_refund_test.rb