Sha256: 65bdd249d299a390fcb31af6696793cb8c97fe8e1e3ce3b2451a39f0f9a53848

Contents?: true

Size: 897 Bytes

Versions: 6

Compression:

Stored size: 897 Bytes

Contents

# frozen_string_literal: true

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

module Stripe
  class SourceTransactionTest < Test::Unit::TestCase
    setup do
      @source = Stripe::Source.retrieve("src_123")
    end

    should "be listable" do
      # TODO: remove the stub once stripe-mock supports /v1/sources/src_.../source_transactions
      stub_request(:get, "#{Stripe.api_base}/v1/sources/#{@source.id}/source_transactions")
        .to_return(body: JSON.generate(
          object: "list",
          data: [
            {
              object: "source_transaction",
            },
          ]
        ))

      transactions = @source.source_transactions

      assert_requested :get, "#{Stripe.api_base}/v1/sources/#{@source.id}/source_transactions"
      assert transactions.data.is_a?(Array)
      assert transactions.first.is_a?(Stripe::SourceTransaction)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
stripe-3.19.0 test/stripe/source_transaction_test.rb
stripe-3.18.0 test/stripe/source_transaction_test.rb
stripe-3.17.2 test/stripe/source_transaction_test.rb
stripe-3.17.1 test/stripe/source_transaction_test.rb
stripe-3.17.0 test/stripe/source_transaction_test.rb
stripe-3.15.0 test/stripe/source_transaction_test.rb