spec/rest/user_institutions_spec.rb in finapps-2.2.9 vs spec/rest/user_institutions_spec.rb in finapps-2.2.10
- old
+ new
@@ -1,14 +1,9 @@
# frozen_string_literal: true
-require 'spec_helpers/client'
-
RSpec.describe FinApps::REST::UserInstitutions do
include SpecHelpers::Client
- RESULT = 0
- ERROR_MESSAGES = 1
-
describe '#list' do
context 'when successful' do
subject { FinApps::REST::UserInstitutions.new(client).list }
it('returns an array') { expect(subject).to be_a(Array) }
@@ -32,11 +27,11 @@
context 'when valid site_id and params are provided' do
let(:create) { subject.create('valid_site_id', :params) }
it { expect { create }.not_to raise_error }
- it('performs a post and returns the response') { expect(create[RESULT]).to respond_to(:consumer_institution) }
+ it('performs a post and returns the response') { expect(create[RESULTS]).to respond_to(:consumer_institution) }
it('returns no error messages') { expect(create[ERROR_MESSAGES]).to be_empty }
end
# No tests for invalid site_id/params because of API/Yodlee flow
end
@@ -78,11 +73,11 @@
context 'when valid id and params are provided' do
subject { FinApps::REST::UserInstitutions.new(client).mfa_update('valid_id', :params) }
it { expect { subject }.not_to raise_error }
- it('performs a post and returns the response') { expect(subject[RESULT]).to respond_to(:consumer_institution) }
+ it('performs a post and returns the response') { expect(subject[RESULTS]).to respond_to(:consumer_institution) }
it('returns no error messages') { expect(subject[ERROR_MESSAGES]).to be_empty }
end
context 'when invalid id is provided w/ params' do
subject { FinApps::REST::UserInstitutions.new(client).mfa_update('invalid_id', :params) }
@@ -106,10 +101,10 @@
context 'when valid id and params are provided' do
subject { FinApps::REST::UserInstitutions.new(client).credentials_update('valid_id', :params) }
it { expect { subject }.not_to raise_error }
- it('performs a post and returns the response') { expect(subject[RESULT]).to respond_to(:consumer_institution) }
+ it('performs a post and returns the response') { expect(subject[RESULTS]).to respond_to(:consumer_institution) }
it('returns no error messages') { expect(subject[ERROR_MESSAGES]).to be_empty }
end
context 'when invalid id is provided w/ params' do
subject { FinApps::REST::UserInstitutions.new(client).credentials_update('invalid_id', :params) }