Sha256: cf9b4d5eaa816277b858520f2b7e3217148e75304b311a1e2e17b210b465f4c1

Contents?: true

Size: 740 Bytes

Versions: 2

Compression:

Stored size: 740 Bytes

Contents

# frozen_string_literal: true

require 'spec_helpers/client'

RSpec.describe FinApps::REST::Products,
               'initialized with valid FinApps::Client object' do
  include SpecHelpers::Client
  subject(:products) { described_class.new(client) }

  describe '#list' do
    context 'when called' do
      let(:list) { subject.list }
      let(:results) { list[0] }
      let(:error_messages) { list[1] }

      it { expect { list }.not_to raise_error }
      it('returns an array of records') { expect(results).to be_a(Array) }

      it('performs a get and returns the response') do
        expect(results[0]).to have_key(:code)
      end

      it('returns no error messages') { expect(error_messages).to be_empty }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
finapps-5.0.34 spec/rest/products_spec.rb
finapps-5.0.33 spec/rest/products_spec.rb