spec/rest/orders_spec.rb in finapps-2.2.5 vs spec/rest/orders_spec.rb in finapps-2.2.6

- old
+ new

@@ -1,9 +1,9 @@ # frozen_string_literal: true RSpec.describe FinApps::REST::Orders do include SpecHelpers::Client - + RESULTS = 0 ERROR_MESSAGES = 1 describe '#show' do context 'when missing params' do @@ -47,35 +47,37 @@ subject { FinApps::REST::Orders.new(client).create(invalid_params) } let(:invalid_params) { {applicant: 'valid'} } it { expect { subject }.not_to raise_error } it('results is nil') { expect(subject[RESULTS]).to be_nil } - it('error messages array is populated') { expect(subject[ERROR_MESSAGES].first.downcase).to eq('invalid request body') } + it('error messages array is populated') do + expect(subject[ERROR_MESSAGES].first.downcase).to eq('invalid request body') + end end end describe '#list' do context 'when missing params' do # use defaults - subject { FinApps::REST::Orders.new(client).list(nil) } + subject { FinApps::REST::Orders.new(client).list } 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[RESULTS]).to respond_to(:orders) } it('returns no error messages') { expect(subject[ERROR_MESSAGES]).to be_empty } end - context 'when including partial params' do - subject { FinApps::REST::Orders.new(client).list(params) } - let(:params) { {page: 2, sort: 'status'} } - - 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[RESULTS]).to respond_to(:orders) } - it('each order contains a consumer_id') { expect(subject[RESULTS].orders).to all(respond_to(:consumer_id)) } - it('returns no error messages') { expect(subject[ERROR_MESSAGES]).to be_empty } - end + # context 'when including partial params' do + # subject { FinApps::REST::Orders.new(client).list(params) } + # let(:params) { {page: 2, sort: 'status'} } + # + # 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[RESULTS]).to respond_to(:orders) } + # it('each order contains a consumer_id') { expect(subject[RESULTS].orders).to all(respond_to(:consumer_id)) } + # it('returns no error messages') { expect(subject[ERROR_MESSAGES]).to be_empty } + # end end describe '#update' do subject(:orders) { FinApps::REST::Orders.new(client) }