Sha256: d43a6b4d5d60c86ecc7ebb380f6a36977e698bfe3d05198822c166983ae44345

Contents?: true

Size: 1.38 KB

Versions: 25

Compression:

Stored size: 1.38 KB

Contents

require File.expand_path('../../test_helper', __FILE__)

module Stripe
  class DisputeTest < Test::Unit::TestCase
    should "disputes should be retrievable" do
      @mock.expects(:get).once.returns(make_response(make_dispute))
      d = Stripe::Dispute.retrieve('dp_test_dispute')
      assert d.kind_of?(Stripe::Dispute)
    end

    should "disputes should be listable" do
      @mock.expects(:get).once.returns(make_response(make_dispute_array))
      d = Stripe::Dispute.list
      assert d.data.kind_of? Array
      d.each do |dispute|
        assert dispute.kind_of?(Stripe::Dispute)
      end
    end

    should "disputes should be closeable" do
      @mock.expects(:get).never
      @mock.expects(:post).with(
        "#{Stripe.api_base}/v1/disputes/test_dispute/close",
        nil,
        ''
      ).once.returns(make_response({:id => 'dp_test_dispute', :status => 'lost'}))
      d = Stripe::Dispute.new('test_dispute')
      d.close
    end

    should "disputes should be updateable" do
      @mock.expects(:get).once.returns(make_response(make_dispute))
      @mock.expects(:post).with(
        "#{Stripe.api_base}/v1/disputes/dp_test_dispute",
        nil,
        'evidence[customer_name]=customer'
      ).once.returns(make_response(make_dispute))

      d = Stripe::Dispute.new('test_dispute')
      d.refresh
      d.evidence['customer_name'] = 'customer'
      d.save
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
stripe-1.43.1 test/stripe/dispute_test.rb
stripe-1.43.0 test/stripe/dispute_test.rb
stripe-1.42.0 test/stripe/dispute_test.rb
stripe-1.41.0 test/stripe/dispute_test.rb
stripe-1.40.0 test/stripe/dispute_test.rb
stripe-1.39.0 test/stripe/dispute_test.rb
stripe-1.38.0 test/stripe/dispute_test.rb
stripe-1.37.0 test/stripe/dispute_test.rb
stripe-1.36.2 test/stripe/dispute_test.rb
stripe-1.36.1 test/stripe/dispute_test.rb
stripe-1.36.0 test/stripe/dispute_test.rb
stripe-1.35.1 test/stripe/dispute_test.rb
stripe-1.35.0 test/stripe/dispute_test.rb
stripe-1.34.0 test/stripe/dispute_test.rb
stripe-1.33.1 test/stripe/dispute_test.rb
stripe-1.33.0 test/stripe/dispute_test.rb
stripe-1.32.1 test/stripe/dispute_test.rb
stripe-1.32.0 test/stripe/dispute_test.rb
stripe-1.31.0 test/stripe/dispute_test.rb
stripe-1.30.3 test/stripe/dispute_test.rb