Sha256: baca826bb5833261706d7795514695a4b57c7a14c2b9c223ca889314f77efc71

Contents?: true

Size: 782 Bytes

Versions: 3

Compression:

Stored size: 782 Bytes

Contents

# frozen_string_literal: true
RSpec.describe FinApps::REST::Orders do
  describe '#show' do
    let(:client) { FinApps::REST::Client.new :company_identifier, :company_token }

    context 'when missing params' do
      subject { FinApps::REST::Orders.new(client).show(nil) }
      it { expect { subject }.to raise_error(FinApps::MissingArgumentsError) }
    end

    context 'when valid params are provided' do
      subject { FinApps::REST::Orders.new(client).show(:id) }

      it { expect { subject }.not_to raise_error }
      it('returns an array') { expect(subject).to be_a(Array) }
      it('performs a post and returns the response') { expect(subject[0]).to respond_to(:public_id) }
      it('returns no error messages') { expect(subject[1]).to be_empty }
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
finapps-2.0.12 spec/rest/orders_spec.rb
finapps-2.0.11 spec/rest/orders_spec.rb
finapps-2.0.10 spec/rest/orders_spec.rb