Sha256: 04be2aea59f740b49b92afa2aba4ade7368c779a942dc9e604614162521236c8

Contents?: true

Size: 1.76 KB

Versions: 26

Compression:

Stored size: 1.76 KB

Contents

# frozen_string_literal: true

require 'spec_helpers/client'
require 'rest/api_request'

RSpec.describe FinApps::REST::VerixRecords do
  include SpecHelpers::Client

  let(:api_client) { client }

  describe '#create' do
    subject(:create) do
      described_class.new(api_client).create(
        code: 'authcode'
      )
    end

    it_behaves_like 'an API request'
    it_behaves_like 'a successful request'
    it('returns an id') { expect(create[RESULTS]).to have_key(:_id) }

    it('returns a consumer id') {
      expect(create[RESULTS]).to have_key(:consumer_id)
    }

    it('returns a status') { expect(create[RESULTS]).to have_key(:status) }
    it('returns an error node') { expect(create[RESULTS]).to have_key(:error) }

    it('returns a list of documents') {
      expect(create[RESULTS]).to have_key(:documents)
    }

    it('returns a list of downloaded documents') {
      expect(create[RESULTS]).to have_key(:downloaded_documents)
    }
  end

  describe '#list' do
    subject(:list) { described_class.new(api_client).list }

    it_behaves_like 'an API request'
    it_behaves_like 'a successful request'
    it('returns an array') { expect(list[RESULTS]).to be_an_instance_of(Array) }
    it('returns an id') { expect(list[RESULTS].first).to have_key(:_id) }
    it('returns a status') { expect(list[RESULTS].first).to have_key(:status) }

    it('returns a consumer id') {
      expect(list[RESULTS].first).to have_key(:consumer_id)
    }

    it('returns an error node') {
      expect(list[RESULTS].first).to have_key(:error)
    }

    it('returns a list of documents') {
      expect(list[RESULTS].first).to have_key(:documents)
    }

    it('returns a list of downloaded documents') {
      expect(list[RESULTS].first).to have_key(:downloaded_documents)
    }
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
finapps-6.4.3 spec/rest/verix/verix_records_spec.rb
finapps-6.4.2 spec/rest/verix/verix_records_spec.rb
finapps-6.4.1 spec/rest/verix/verix_records_spec.rb
finapps-6.4.0 spec/rest/verix/verix_records_spec.rb
finapps-6.3.1 spec/rest/verix/verix_records_spec.rb
finapps-6.3.0 spec/rest/verix/verix_records_spec.rb
finapps-6.2.0 spec/rest/verix/verix_records_spec.rb
finapps-6.1.0 spec/rest/verix/verix_records_spec.rb
finapps-6.0.0 spec/rest/verix/verix_records_spec.rb
finapps-5.4.1 spec/rest/verix/verix_records_spec.rb
finapps-5.4.0 spec/rest/verix/verix_records_spec.rb
finapps-5.3.0 spec/rest/verix/verix_records_spec.rb
finapps-5.2.1 spec/rest/verix/verix_records_spec.rb
finapps-5.2.0 spec/rest/verix/verix_records_spec.rb
finapps-5.1.0 spec/rest/verix/verix_records_spec.rb
finapps-5.0.47 spec/rest/verix/verix_records_spec.rb
finapps-5.0.46 spec/rest/verix/verix_records_spec.rb
finapps-5.0.45 spec/rest/verix/verix_records_spec.rb
finapps-5.0.44 spec/rest/verix/verix_records_spec.rb
finapps-5.0.43 spec/rest/verix/verix_records_spec.rb