Sha256: fef58b9e66fa9fff7409d3ad30405a7dac23baa3ec472405a594b2724f6da3a5

Contents?: true

Size: 1.16 KB

Versions: 20

Compression:

Stored size: 1.16 KB

Contents

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

20 entries across 20 versions & 1 rubygems

Version Path
stripe-3.14.0 test/stripe/refund_test.rb
stripe-3.13.1 test/stripe/refund_test.rb
stripe-3.13.0 test/stripe/refund_test.rb
stripe-3.12.1 test/stripe/refund_test.rb
stripe-3.12.0 test/stripe/refund_test.rb
stripe-3.11.0 test/stripe/refund_test.rb
stripe-3.10.0 test/stripe/refund_test.rb
stripe-3.9.2 test/stripe/refund_test.rb
stripe-3.9.1 test/stripe/refund_test.rb
stripe-3.9.0 test/stripe/refund_test.rb
stripe-3.8.2 test/stripe/refund_test.rb
stripe-3.8.1 test/stripe/refund_test.rb
stripe-3.8.0 test/stripe/refund_test.rb
stripe-3.7.0 test/stripe/refund_test.rb
stripe-3.6.0 test/stripe/refund_test.rb
stripe-3.5.3 test/stripe/refund_test.rb
stripe-3.5.2 test/stripe/refund_test.rb
stripe-3.5.1 test/stripe/refund_test.rb
stripe-3.5.0 test/stripe/refund_test.rb
stripe-3.4.1 test/stripe/refund_test.rb