Sha256: 6a586d29f97185fb53a02655ffdee6ebd4fcc65d7467e05eac53441d19c50b92
Contents?: true
Size: 1.52 KB
Versions: 4
Compression:
Stored size: 1.52 KB
Contents
# frozen_string_literal: true RSpec.describe FinApps::REST::UserInstitutionsStatuses do include SpecHelpers::Client describe '#show' do context 'when missing id' do subject { FinApps::REST::UserInstitutionsStatuses.new(client).show(nil) } it { expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError) } end context 'when valid id is provided' do subject { FinApps::REST::UserInstitutionsStatuses.new(client).show('valid_id') } it { expect { subject }.not_to raise_error } it('returns an array') { expect(subject).to be_a(Array) } it('performs a get and returns the response') { expect(subject[0]).to respond_to(:_id) } it('returns no error messages') { expect(subject[1]).to be_empty } end context 'when invalid id is provided' do subject { FinApps::REST::UserInstitutionsStatuses.new(client).show('invalid_id') } it { expect { subject }.not_to raise_error } it('results is nil') { expect(subject[0]).to be_nil } it('error messages array is populated') { expect(subject[1].first.downcase).to eq('invalid user institution id') } end end describe '#update' do context 'when successful' do subject { FinApps::REST::UserInstitutionsStatuses.new(client).update } it('returns an array') { expect(subject).to be_a(Array) } it('performs a get and returns array of user institutions statuses') { expect(subject[0]).to be_a(Array) } it('returns no error messages') { expect(subject[1]).to be_empty } end end end
Version data entries
4 entries across 4 versions & 1 rubygems