Sha256: 4eeeb65695acabe38653c437045c55880ccde93205ef75254ad9ff102e8e7237

Contents?: true

Size: 1.29 KB

Versions: 20

Compression:

Stored size: 1.29 KB

Contents

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

module Stripe
  class BankAccountTest < Test::Unit::TestCase
    FIXTURE = API_FIXTURES.fetch(:external_account_source)

    context "#resource_url" do
      should "return an external account URL" do
        account_id = API_FIXTURES.fetch(:account)[:id]
        bank_account = Stripe::BankAccount.construct_from(
          account: account_id,
          id: FIXTURE[:id]
        )
        assert_equal "/v1/accounts/#{account_id}/external_accounts/#{FIXTURE[:id]}",
          bank_account.resource_url
      end

      should "return a customer URL" do
        customer_id = API_FIXTURES.fetch(:customer)[:id]
        bank_account = Stripe::BankAccount.construct_from(
          customer: customer_id,
          id: FIXTURE[:id]
        )
        assert_equal "/v1/customers/#{customer_id}/sources/#{FIXTURE[:id]}",
          bank_account.resource_url
      end
    end

    context "#verify" do
      should 'verify the account' do
        customer_id = API_FIXTURES.fetch(:customer)[:id]
        bank_account = Stripe::BankAccount.construct_from({
          customer: customer_id,
          id: FIXTURE[:id]
        })
        bank_account = bank_account.verify(amounts: [1,2])
        assert bank_account.kind_of?(Stripe::BankAccount)
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
stripe-3.0.3 test/stripe/bank_account_test.rb
stripe-3.0.1 test/stripe/bank_account_test.rb
stripe-3.0.0 test/stripe/bank_account_test.rb
stripe-2.12.0 test/stripe/bank_account_test.rb
stripe-2.11.0 test/stripe/bank_account_test.rb
stripe-2.10.0 test/stripe/bank_account_test.rb
stripe-2.9.0 test/stripe/bank_account_test.rb
stripe-2.8.0 test/stripe/bank_account_test.rb
stripe-2.7.0 test/stripe/bank_account_test.rb
stripe-2.6.0 test/stripe/bank_account_test.rb
stripe-2.5.0 test/stripe/bank_account_test.rb
stripe-2.4.0 test/stripe/bank_account_test.rb
stripe-2.3.0 test/stripe/bank_account_test.rb
stripe-2.2.1 test/stripe/bank_account_test.rb
stripe-2.2.0 test/stripe/bank_account_test.rb
stripe-2.1.0 test/stripe/bank_account_test.rb
stripe-2.0.3 test/stripe/bank_account_test.rb
stripe-2.0.2 test/stripe/bank_account_test.rb
stripe-2.0.1 test/stripe/bank_account_test.rb
stripe-2.0.0 test/stripe/bank_account_test.rb