Sha256: 8d79dc831222759a67c7f5a35a2d0c96cf224b5ebe3d802c9bf0a2a000336271

Contents?: true

Size: 1.05 KB

Versions: 10

Compression:

Stored size: 1.05 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

10 entries across 10 versions & 1 rubygems

Version Path
stripe-3.23.0 test/stripe/application_fee_refund_test.rb
stripe-3.22.0 test/stripe/application_fee_refund_test.rb
stripe-3.21.0 test/stripe/application_fee_refund_test.rb
stripe-3.20.0 test/stripe/application_fee_refund_test.rb
stripe-3.19.0 test/stripe/application_fee_refund_test.rb
stripe-3.18.0 test/stripe/application_fee_refund_test.rb
stripe-3.17.2 test/stripe/application_fee_refund_test.rb
stripe-3.17.1 test/stripe/application_fee_refund_test.rb
stripe-3.17.0 test/stripe/application_fee_refund_test.rb
stripe-3.15.0 test/stripe/application_fee_refund_test.rb