Sha256: ee6dfd7d0f02503c7aec35cbe60d3bc72486720e80ca7a98822e5bd6c4f736e4

Contents?: true

Size: 1.15 KB

Versions: 19

Compression:

Stored size: 1.15 KB

Contents

# frozen_string_literal: true

require 'spec_helpers/client'
require 'rest/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

19 entries across 19 versions & 1 rubygems

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