Sha256: 21ed53d1107c9d6e11e4853337c78c43b01aa6b4c83186abb4ec1990b25df667
Contents?: true
Size: 1.3 KB
Versions: 58
Compression:
Stored size: 1.3 KB
Contents
require 'spec_helper' RSpec.describe RockRMS::Client::PaymentDetail, type: :model do include_context 'resource specs' describe '#list_payment_details' do it 'returns a array' do resource = client.list_payment_details expect(resource).to be_a(Array) expect(resource.first).to be_a(Hash) end end describe '#create_payment_detail' do context 'arguments' do it 'require `payment_type`' do expect { client.create_payment_detail } .to raise_error(ArgumentError, /payment_type/) end end subject(:resource) do client.create_payment_detail(payment_type: 'card', card_type: 'amex') end it 'returns integer' do expect(resource).to be_a(Integer) end it 'passes options' do expect(client).to receive(:post) .with( 'FinancialPaymentDetails', 'CurrencyTypeValueId' => 156, 'CreditCardTypeValueId' => 159, 'ForeignKey' => nil ) .and_call_original resource end end describe '#delete_payment_detail' do it 'returns nothing' do expect(client.delete_payment_detail(123)).to eq(nil) end it 'passes id' do expect(client).to receive(:delete).with('FinancialPaymentDetails/123') client.delete_payment_detail(123) end end end
Version data entries
58 entries across 58 versions & 1 rubygems