Sha256: aec2cea27051a0f05afca20ac8b2c61e241127dcba546d930dd62db919b0efac

Contents?: true

Size: 1.52 KB

Versions: 30

Compression:

Stored size: 1.52 KB

Contents

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

module Stripe
  class CountrySpecTest < Test::Unit::TestCase
    should "be listable" do
      @mock.expects(:get).once.
      returns(make_response(country_spec_array))
      c = Stripe::CountrySpec.list

      assert_equal('/v1/country_specs', c.resource_url)
      assert_equal('list', c.object)
      assert(c.data.kind_of?(Array))
      assert_equal('US', c.data[0].id)
      assert(c.data[0].kind_of?(Stripe::CountrySpec))
    end

    should "be retrievable" do
      resp = make_country_spec
      @mock.expects(:get).once.
      with('https://api.stripe.com/v1/country_specs/US', nil, nil).
      returns(make_response(resp))
      s = Stripe::CountrySpec.retrieve('US')

      assert_equal('/v1/country_specs/US', s.resource_url)
      assert_equal('country_spec', s.object)
      assert(s.kind_of?(Stripe::CountrySpec))

      s.supported_bank_account_currencies.map{ |k,v|  assert v.kind_of?(Array) }
      assert_equal(['US'], s.supported_bank_account_currencies['usd'])
      assert(s.supported_payment_currencies.include?('usd'))
      assert s.supported_payment_currencies.kind_of?(Array)
      assert s.supported_payment_methods.kind_of?(Array)

      ['individual', 'company'].map{ |type|
        item = s.verification_fields[type]
        assert item.minimum.include?('external_account')
        assert item.additional.include?('legal_entity.verification.document')
        assert item.additional.kind_of?(Array)
        assert item.minimum.kind_of?(Array)
      }
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
stripe-1.58.0 test/stripe/country_spec_test.rb
stripe-1.57.1 test/stripe/country_spec_test.rb
stripe-1.57.0 test/stripe/country_spec_test.rb
stripe-1.56.2 test/stripe/country_spec_test.rb
stripe-1.56.1 test/stripe/country_spec_test.rb
stripe-1.56.0 test/stripe/country_spec_test.rb
stripe-1.55.1 test/stripe/country_spec_test.rb
stripe-1.55.0 test/stripe/country_spec_test.rb
stripe-1.54.0 test/stripe/country_spec_test.rb
stripe-1.53.0 test/stripe/country_spec_test.rb
stripe-1.52.0 test/stripe/country_spec_test.rb
stripe-1.51.1 test/stripe/country_spec_test.rb
stripe-1.51.0 test/stripe/country_spec_test.rb
stripe-1.50.1 test/stripe/country_spec_test.rb
stripe-1.50.0 test/stripe/country_spec_test.rb
stripe-1.49.0 test/stripe/country_spec_test.rb
stripe-1.48.0 test/stripe/country_spec_test.rb
stripe-1.47.0 test/stripe/country_spec_test.rb
stripe-1.46.0 test/stripe/country_spec_test.rb
stripe-1.45.0 test/stripe/country_spec_test.rb