spec/rest/orders_spec.rb in finapps-2.0.21 vs spec/rest/orders_spec.rb in finapps-2.0.22

- old
+ new

@@ -33,20 +33,20 @@ describe '#update' do subject(:orders) { FinApps::REST::Orders.new(client) } context 'when missing id' do let(:update) { subject.update(nil, :params) } - it ('returns missing argument error') { expect { update }.to raise_error(FinApps::MissingArgumentsError) } + it('returns missing argument error') { expect { update }.to raise_error(FinApps::MissingArgumentsError) } end context 'when missing params' do let(:update) { subject.update(:id, nil) } - it ('returns missing argument error') { expect { update }.to raise_error(FinApps::MissingArgumentsError) } + it('returns missing argument error') { expect { update }.to raise_error(FinApps::MissingArgumentsError) } end context 'when valid id and params are provided' do - let(:update) { subject.update('valid_id', {accounts: 'valid_account'}) } #how to stub params + let(:update) { subject.update('valid_id', accounts: 'valid_account') } # how to stub params let(:results) { update[0] } let(:error_messages) { update[1] } it { expect { update }.not_to raise_error } it('results is nil') { expect(results).to be_nil } @@ -62,16 +62,15 @@ it('results is nil') { expect(results).to be_nil } it('error messages array is populated') { expect(error_messages.first.downcase).to eq('resource not found') } end context 'when invalid params are provided' do - let(:update) { subject.update('valid_id', {accounts: 'invalid_account'}) } + let(:update) { subject.update('valid_id', accounts: 'invalid_account') } let(:results) { update[0] } let(:error_messages) { update[1] } it { expect { update }.not_to raise_error } it('results is nil') { expect(results).to be_nil } it('error messages array is populated') { expect(error_messages.first.downcase).to eq('invalid request body') } - end end end