Sha256: 94dbaadfabe78bff573ee3329897ca800227c825deaf0f0386f3dc718342f54a

Contents?: true

Size: 1.13 KB

Versions: 32

Compression:

Stored size: 1.13 KB

Contents

# frozen_string_literal: true

require 'spec_helpers/client'
RSpec.describe FinApps::REST::InstitutionsForms do
  include SpecHelpers::Client

  describe '#show' do
    context 'when missing site id' do
      subject { FinApps::REST::InstitutionsForms.new(client).show(nil) }
      it('raises missing argument error') { expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError) }
    end

    context 'when valid site id provided' do
      subject { FinApps::REST::InstitutionsForms.new(client).show('valid_site_id') }

      it { expect { subject }.not_to raise_error }
      it('performs a get and returns the login html') { expect(subject[0]).to respond_to(:login_form_html) }
      it('returns no error messages') { expect(subject[1]).to be_empty }
    end

    context 'when invalid site id provided' do
      subject { FinApps::REST::InstitutionsForms.new(client).show('invalid_site_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 institution id') }
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
finapps-5.0.3 spec/rest/institutions_forms_spec.rb
finapps-5.0.2 spec/rest/institutions_forms_spec.rb
finapps-5.0.1 spec/rest/institutions_forms_spec.rb
finapps-5.0.0 spec/rest/institutions_forms_spec.rb
finapps-4.0.16 spec/rest/institutions_forms_spec.rb
finapps-4.0.15 spec/rest/institutions_forms_spec.rb
finapps-4.0.14 spec/rest/institutions_forms_spec.rb
finapps-4.0.12 spec/rest/institutions_forms_spec.rb
finapps-4.0.11 spec/rest/institutions_forms_spec.rb
finapps-4.0.10 spec/rest/institutions_forms_spec.rb
finapps-4.0.9 spec/rest/institutions_forms_spec.rb
finapps-4.0.8 spec/rest/institutions_forms_spec.rb
finapps-4.0.7 spec/rest/institutions_forms_spec.rb
finapps-4.0.6 spec/rest/institutions_forms_spec.rb
finapps-4.0.5 spec/rest/institutions_forms_spec.rb
finapps-4.0.4 spec/rest/institutions_forms_spec.rb
finapps-4.0.3 spec/rest/institutions_forms_spec.rb
finapps-4.0.2 spec/rest/institutions_forms_spec.rb
finapps-4.0.1 spec/rest/institutions_forms_spec.rb
finapps-3.0.7 spec/rest/institutions_forms_spec.rb