Sha256: 3508f3b5adaf08d33f261f3493fb65e973e9a93c48f59025d45cda1449222bb1

Contents?: true

Size: 1.07 KB

Versions: 26

Compression:

Stored size: 1.07 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
      described_class.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) { described_class.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

26 entries across 26 versions & 1 rubygems

Version Path
finapps-6.4.3 spec/rest/plaid/plaid_accounts_spec.rb
finapps-6.4.2 spec/rest/plaid/plaid_accounts_spec.rb
finapps-6.4.1 spec/rest/plaid/plaid_accounts_spec.rb
finapps-6.4.0 spec/rest/plaid/plaid_accounts_spec.rb
finapps-6.3.1 spec/rest/plaid/plaid_accounts_spec.rb
finapps-6.3.0 spec/rest/plaid/plaid_accounts_spec.rb
finapps-6.2.0 spec/rest/plaid/plaid_accounts_spec.rb
finapps-6.1.0 spec/rest/plaid/plaid_accounts_spec.rb
finapps-6.0.0 spec/rest/plaid/plaid_accounts_spec.rb
finapps-5.4.1 spec/rest/plaid/plaid_accounts_spec.rb
finapps-5.4.0 spec/rest/plaid/plaid_accounts_spec.rb
finapps-5.3.0 spec/rest/plaid/plaid_accounts_spec.rb
finapps-5.2.1 spec/rest/plaid/plaid_accounts_spec.rb
finapps-5.2.0 spec/rest/plaid/plaid_accounts_spec.rb
finapps-5.1.0 spec/rest/plaid/plaid_accounts_spec.rb
finapps-5.0.47 spec/rest/plaid/plaid_accounts_spec.rb
finapps-5.0.46 spec/rest/plaid/plaid_accounts_spec.rb
finapps-5.0.45 spec/rest/plaid/plaid_accounts_spec.rb
finapps-5.0.44 spec/rest/plaid/plaid_accounts_spec.rb
finapps-5.0.43 spec/rest/plaid/plaid_accounts_spec.rb