Sha256: b95bd772b9d4737cd7d7bacc7e9251074dfcb038b920921aa95a99c9c18a5c62

Contents?: true

Size: 1.54 KB

Versions: 32

Compression:

Stored size: 1.54 KB

Contents

# frozen_string_literal: true

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

module Stripe
  module Issuing
    class DisputeTest < Test::Unit::TestCase
      should "be creatable" do
        dispute = Stripe::Issuing::Dispute.create(
          reason: "fraudulent",
          disputed_transaction: "ipi_123"
        )
        assert_requested :post, "#{Stripe.api_base}/v1/issuing/disputes"
        assert dispute.is_a?(Stripe::Issuing::Dispute)
      end

      should "be listable" do
        disputes = Stripe::Issuing::Dispute.list
        assert_requested :get, "#{Stripe.api_base}/v1/issuing/disputes"
        assert disputes.data.is_a?(Array)
        assert disputes.data[0].is_a?(Stripe::Issuing::Dispute)
      end

      should "be retrievable" do
        dispute = Stripe::Issuing::Dispute.retrieve("ich_123")
        assert_requested :get, "#{Stripe.api_base}/v1/issuing/disputes/ich_123"
        assert dispute.is_a?(Stripe::Issuing::Dispute)
      end

      should "be saveable" do
        dispute = Stripe::Issuing::Dispute.retrieve("ich_123")
        dispute.metadata["key"] = "value"
        dispute.save
        assert_requested :post, "#{Stripe.api_base}/v1/issuing/disputes/#{dispute.id}"
        assert dispute.is_a?(Stripe::Issuing::Dispute)
      end

      should "be updateable" do
        dispute = Stripe::Issuing::Dispute.update("ich_123", metadata: { foo: "bar" })
        assert_requested :post, "#{Stripe.api_base}/v1/issuing/disputes/ich_123"
        assert dispute.is_a?(Stripe::Issuing::Dispute)
      end
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

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