Sha256: fb91f1ffc631c169bcd29eec62cb7a6db283291bf5b7688bd5c98afa8a8c4c46
Contents?: true
Size: 1.62 KB
Versions: 32
Compression:
Stored size: 1.62 KB
Contents
# frozen_string_literal: true require 'spec_helpers/client' 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[RESULTS]).to respond_to(:_id) } it('returns no error messages') { expect(subject[ERROR_MESSAGES]).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[RESULTS]).to be_nil } it('error messages array is populated') do expect(subject[ERROR_MESSAGES].first.downcase).to eq('invalid user institution id') end 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[RESULTS]).to be_a(Array) } it('returns no error messages') { expect(subject[ERROR_MESSAGES]).to be_empty } end end end
Version data entries
32 entries across 32 versions & 1 rubygems