Sha256: f45a11623a1aea97ecd44c9187445c600972275398b244c977a82357028ee3a2

Contents?: true

Size: 1.16 KB

Versions: 16

Compression:

Stored size: 1.16 KB

Contents

# frozen_string_literal: true

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

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

  let(:api_client) { client }
  let(:document) { described_class.new(api_client) }

  describe '#list' do
    subject { document.list(:record_id) }

    context 'when missing parameters' do
      subject(:list) { document.list(nil) }

      it 'raises an error when missing record id' do
        expect { list }.to raise_error(FinAppsCore::MissingArgumentsError)
      end
    end

    it_behaves_like 'an API request'
    it_behaves_like 'a successful request'
  end

  describe '#show' do
    subject { document.show(:record_id, :document_id) }

    context 'when missing record_id' do
      subject(:show) { document.show(nil, :document_id) }

      it { expect { show }.to raise_error(FinAppsCore::MissingArgumentsError) }
    end

    context 'when missing document_id' do
      subject(:show) { document.show(:record_id, nil) }

      it { expect { show }.to raise_error(FinAppsCore::MissingArgumentsError) }
    end

    it_behaves_like 'an API request'
    it_behaves_like 'a successful request'
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
finapps-6.13.1 spec/rest/verix/verix_documents_spec.rb
finapps-6.13.0 spec/rest/verix/verix_documents_spec.rb
finapps-6.12.0 spec/rest/verix/verix_documents_spec.rb
finapps-6.11.0 spec/rest/verix/verix_documents_spec.rb
finapps-6.10.2 spec/rest/verix/verix_documents_spec.rb
finapps-6.10.1 spec/rest/verix/verix_documents_spec.rb
finapps-6.10.0 spec/rest/verix/verix_documents_spec.rb
finapps-6.9.2 spec/rest/verix/verix_documents_spec.rb
finapps-6.9.1 spec/rest/verix/verix_documents_spec.rb
finapps-6.9.0 spec/rest/verix/verix_documents_spec.rb
finapps-6.8.0 spec/rest/verix/verix_documents_spec.rb
finapps-6.7.1 spec/rest/verix/verix_documents_spec.rb
finapps-6.7.0 spec/rest/verix/verix_documents_spec.rb
finapps-6.6.1 spec/rest/verix/verix_documents_spec.rb
finapps-6.6.0 spec/rest/verix/verix_documents_spec.rb
finapps-6.5.0 spec/rest/verix/verix_documents_spec.rb