Sha256: 595abdd005ca510733739445bf5d916c6e8c127e0b549cec9b624b886e4cadb3

Contents?: true

Size: 1.08 KB

Versions: 67

Compression:

Stored size: 1.08 KB

Contents

require_relative 'test_helper'

# Internal: The test for Plaid::Identity.
class PlaidIdentityTest < PlaidTest
  def test_get
    create_item initial_products: [:identity]

    identity_get_request = Plaid::IdentityGetRequest.new
    identity_get_request.access_token = access_token

    response = client.identity_get(identity_get_request)
    assert_kind_of(Plaid::IdentityGetResponse, response)

    refute_empty(response.accounts)

    response.accounts.each do |account|
      refute_empty(account.owners)
      account.owners.each do |identity|
        refute_empty(identity.addresses)
        refute_empty(identity.emails)
        refute_empty(identity.names)
        refute_empty(identity.phone_numbers)
      end
    end
  end

  def test_get_invalid_access_token
    identity_get_request = Plaid::IdentityGetRequest.new
    identity_get_request.access_token = BAD_STRING

    begin
      client.identity_get(identity_get_request)
    rescue Plaid::ApiError => e
      json_response = JSON.parse(e.response_body)
      assert_equal(json_response["error_code"], "INVALID_ACCESS_TOKEN")
    end
  end
end

Version data entries

67 entries across 67 versions & 1 rubygems

Version Path
plaid-35.0.0 test/test_identity.rb
plaid-34.0.0 test/test_identity.rb
plaid-33.0.0 test/test_identity.rb
plaid-32.0.0 test/test_identity.rb
plaid-31.0.0 test/test_identity.rb
plaid-30.0.0 test/test_identity.rb
plaid-29.0.0 test/test_identity.rb
plaid-27.0.0 test/test_identity.rb
plaid-26.0.1 test/test_identity.rb
plaid-26.0.0 test/test_identity.rb
plaid-25.0.0 test/test_identity.rb
plaid-24.4.0 test/test_identity.rb
plaid-24.3.0 test/test_identity.rb
plaid-24.2.0 test/test_identity.rb
plaid-24.0.0 test/test_identity.rb
plaid-23.0.0 test/test_identity.rb
plaid-22.0.0 test/test_identity.rb
plaid-21.3.0 test/test_identity.rb
plaid-21.2.0 test/test_identity.rb
plaid-21.1.0 test/test_identity.rb