spec/rest/orders_spec.rb in finapps-2.0.17 vs spec/rest/orders_spec.rb in finapps-2.0.19

- old
+ new

@@ -1,10 +1,9 @@ # frozen_string_literal: true RSpec.describe FinApps::REST::Orders do + let(:client) { FinApps::REST::Client.new(:company_identifier, :company_token) } 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 @@ -12,9 +11,22 @@ 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 + + describe '#list' do + context 'when missing params' do + # use defaults + + subject { FinApps::REST::Orders.new(client).list(nil) } + it { expect { subject }.not_to raise_error } + + it('returns an array') { expect(subject).to be_a(Array) } + it('performs a get and returns the response') { expect(subject[0]).to respond_to(:orders) } it('returns no error messages') { expect(subject[1]).to be_empty } end end end