Sha256: e37b1fb2fde038b01d5118b81571631ed2045bc9175ac80c20946d149acb5759

Contents?: true

Size: 1.08 KB

Versions: 21

Compression:

Stored size: 1.08 KB

Contents

# frozen_string_literal: true

require 'spec_helpers/client'
require 'rest/api_request'

RSpec.describe FinApps::REST::PlaidAccounts do
  include SpecHelpers::Client

  # noinspection RubyBlockToMethodReference
  let(:api_client) { client }

  RSpec.shared_examples 'a request that returns account data' do |_parameter|
    it('returns accounts data') do
      expect(subject[RESULTS]).to have_key(:balances)
    end
  end

  describe '#show' do
    subject(:show) do
      FinApps::REST::PlaidAccounts.new(api_client).show(
        :account_id
      )
    end

    it_behaves_like 'an API request'
    it_behaves_like 'a successful request'
    it_behaves_like 'a request that returns account data'
  end

  describe '#list' do
    subject(:list) { FinApps::REST::PlaidAccounts.new(api_client).list }

    it_behaves_like 'an API request'
    it_behaves_like 'a successful request'
    it('returns an Array of institution data') { expect(list[RESULTS].first).to have_key(:plaid_institution_id) }
    it('returns institution account data') { expect(list[RESULTS].first).to have_key(:accounts) }
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
finapps-5.0.32 spec/rest/plaid/plaid_accounts_spec.rb
finapps-5.0.31 spec/rest/plaid/plaid_accounts_spec.rb
finapps-5.0.30 spec/rest/plaid/plaid_accounts_spec.rb
finapps-5.0.29 spec/rest/plaid/plaid_accounts_spec.rb
finapps-5.0.28 spec/rest/plaid/plaid_accounts_spec.rb
finapps-5.0.27 spec/rest/plaid/plaid_accounts_spec.rb
finapps-5.0.26 spec/rest/plaid/plaid_accounts_spec.rb
finapps-5.0.25 spec/rest/plaid/plaid_accounts_spec.rb
finapps-5.0.24 spec/rest/plaid/plaid_accounts_spec.rb
finapps-5.0.23 spec/rest/plaid/plaid_accounts_spec.rb
finapps-5.0.22 spec/rest/plaid/plaid_accounts_spec.rb
finapps-5.0.21 spec/rest/plaid/plaid_accounts_spec.rb
finapps-5.0.20 spec/rest/plaid/plaid_accounts_spec.rb
finapps-5.0.19 spec/rest/plaid/plaid_accounts_spec.rb
finapps-5.0.17 spec/rest/plaid/plaid_accounts_spec.rb
finapps-5.0.16 spec/rest/plaid/plaid_accounts_spec.rb
finapps-5.0.15 spec/rest/plaid/plaid_accounts_spec.rb
finapps-5.0.14 spec/rest/plaid/plaid_accounts_spec.rb
finapps-5.0.13 spec/rest/plaid/plaid_accounts_spec.rb
finapps-5.0.12 spec/rest/plaid/plaid_accounts_spec.rb