Sha256: f0f90cad15af1369076631f295bfd296e99891693b8658aeaed59495b8f8c88f

Contents?: true

Size: 1.19 KB

Versions: 36

Compression:

Stored size: 1.19 KB

Contents

# frozen_string_literal: true

require ::File.expand_path("../../test_helper", __FILE__)

module Stripe
  class RefundTest < Test::Unit::TestCase
    should "be listable" do
      refunds = Stripe::Refund.list
      assert_requested :get, "#{Stripe.api_base}/v1/refunds"
      assert refunds.data.is_a?(Array)
      assert refunds.first.is_a?(Stripe::Refund)
    end

    should "be retrievable" do
      refund = Stripe::Refund.retrieve("re_123")
      assert_requested :get, "#{Stripe.api_base}/v1/refunds/re_123"
      assert refund.is_a?(Stripe::Refund)
    end

    should "be creatable" do
      refund = Stripe::Refund.create(charge: "ch_123")
      assert_requested :post, "#{Stripe.api_base}/v1/refunds"
      assert refund.is_a?(Stripe::Refund)
    end

    should "be saveable" do
      refund = Stripe::Refund.retrieve("re_123")
      refund.metadata["key"] = "value"
      refund.save
      assert_requested :post, "#{Stripe.api_base}/v1/refunds/#{refund.id}"
    end

    should "be updateable" do
      refund = Stripe::Refund.update("re_123", metadata: { key: "value" })
      assert_requested :post, "#{Stripe.api_base}/v1/refunds/re_123"
      assert refund.is_a?(Stripe::Refund)
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

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