Sha256: dabc245275e68bc0ea9e37fd9a625c898b010f7ade383ea55be8236ac323cb67

Contents?: true

Size: 813 Bytes

Versions: 11

Compression:

Stored size: 813 Bytes

Contents

# frozen_string_literal: true
RSpec.describe FinApps::REST::Institutions do
  let(:client) { FinApps::REST::Client.new(:company_identifier, :company_token) }

  describe '#list' do
    subject(:institutions) { FinApps::REST::Institutions.new(client) }

    context 'when search_term is missing' do
      let(:list) { subject.list(nil) }
      it { expect { list }.to raise_error(FinApps::MissingArgumentsError) }
    end

    context 'when proper search_term is provided' do
      let(:list) { subject.list(:search_term) }

      it { expect { list }.not_to raise_error }
      it('returns an array') { expect(list).to be_a(Array) }
      it('performs a get and returns institution array') { expect(list[0]).to be_a(Array) }
      it('returns no error messages') { expect(list[1]).to be_empty }
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
finapps-2.1.4 spec/rest/institutions_spec.rb
finapps-2.1.3 spec/rest/institutions_spec.rb
finapps-2.1.2 spec/rest/institutions_spec.rb
finapps-2.1.1 spec/rest/institutions_spec.rb
finapps-2.0.30 spec/rest/institutions_spec.rb
finapps-2.0.29 spec/rest/institutions_spec.rb
finapps-2.0.28 spec/rest/institutions_spec.rb
finapps-2.0.27 spec/rest/institutions_spec.rb
finapps-2.0.26 spec/rest/institutions_spec.rb
finapps-2.0.25 spec/rest/institutions_spec.rb
finapps-2.0.24 spec/rest/institutions_spec.rb