Sha256: d778a568cf788a68d1df1519dd55001e4c56725b3596da17ec005dfb432d9c9b

Contents?: true

Size: 778 Bytes

Versions: 40

Compression:

Stored size: 778 Bytes

Contents

# frozen_string_literal: true

require 'spec_helpers/client'

RSpec.describe FinApps::REST::Products do
  context 'when 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
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
finapps-6.13.1 spec/rest/products_spec.rb
finapps-6.13.0 spec/rest/products_spec.rb
finapps-6.12.0 spec/rest/products_spec.rb
finapps-6.11.0 spec/rest/products_spec.rb
finapps-6.10.2 spec/rest/products_spec.rb
finapps-6.10.1 spec/rest/products_spec.rb
finapps-6.10.0 spec/rest/products_spec.rb
finapps-6.9.2 spec/rest/products_spec.rb
finapps-6.9.1 spec/rest/products_spec.rb
finapps-6.9.0 spec/rest/products_spec.rb
finapps-6.8.0 spec/rest/products_spec.rb
finapps-6.7.1 spec/rest/products_spec.rb
finapps-6.7.0 spec/rest/products_spec.rb
finapps-6.6.1 spec/rest/products_spec.rb
finapps-6.6.0 spec/rest/products_spec.rb
finapps-6.5.0 spec/rest/products_spec.rb
finapps-6.4.3 spec/rest/products_spec.rb
finapps-6.4.2 spec/rest/products_spec.rb
finapps-6.4.1 spec/rest/products_spec.rb
finapps-6.4.0 spec/rest/products_spec.rb