Sha256: f3fb3af4b700315100ffed28197597183c7428706ba030924e7261141f55aa48

Contents?: true

Size: 1.07 KB

Versions: 1

Compression:

Stored size: 1.07 KB

Contents

# frozen_string_literal: true

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

  RSpec.shared_examples 'an EdmTransmission response' do
    it_behaves_like 'an API request'
    it_behaves_like 'a successful request'

    it('returns a hash with the correct keys') do
      expect(subject[RESULTS].keys)
        .to(match_array(%i[transmission_id date_created date_modified status
                           document_order_id documents]))
    end
  end

  describe '#create' do
    subject(:list) { described_class.new(client).create(:order_id, params) }

    let(:params) { {external_id: '12345'} }

    it_behaves_like 'an EdmTransmission response'
  end

  describe '#show' do
    subject(:show) { described_class.new(client).show(:transmission_id) }

    it_behaves_like 'an EdmTransmission response'
  end

  describe '#show_by_order' do
    subject(:show) { described_class.new(client).show_by_order(:order_id) }

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

    it_behaves_like 'an EdmTransmission response'
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
finapps-6.13.1 spec/rest/edm_transmissions_spec.rb