Sha256: be8197c5d2ba0a7470a641e8e0b6b4655dadcab1fdc88a9fce60149d24ccfcd7

Contents?: true

Size: 744 Bytes

Versions: 10

Compression:

Stored size: 744 Bytes

Contents

require 'spec_helper'

describe NetSuite::Records::CustomerPaymentCreditList do
  let(:list) { NetSuite::Records::CustomerPaymentCreditList.new }
  let(:apply) { NetSuite::Records::CustomerPaymentCredit.new }

  it 'can have credits be added to it' do
    list.credits << apply
    credit_list = list.credits
    expect(credit_list).to be_kind_of(Array)
    expect(credit_list.length).to eql(1)
    credit_list.each { |i| expect(i).to be_kind_of(NetSuite::Records::CustomerPaymentCredit) }
  end

  describe '#to_record' do
    it 'can represent itself as a SOAP record' do
      record = {
          'tranCust:credit' => [{},{}]
      }

      list.credits.concat([apply, apply])
      expect(list.to_record).to eql(record)
    end
  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
netsuite-0.9.3 spec/netsuite/records/customer_payment_credit_list_spec.rb
netsuite-0.9.2 spec/netsuite/records/customer_payment_credit_list_spec.rb
netsuite-0.9.1 spec/netsuite/records/customer_payment_credit_list_spec.rb
netsuite-0.9.0 spec/netsuite/records/customer_payment_credit_list_spec.rb
netsuite-0.8.12 spec/netsuite/records/customer_payment_credit_list_spec.rb
netsuite-0.8.11 spec/netsuite/records/customer_payment_credit_list_spec.rb
netsuite-0.8.10 spec/netsuite/records/customer_payment_credit_list_spec.rb
netsuite-0.8.9 spec/netsuite/records/customer_payment_credit_list_spec.rb
netsuite-0.8.8 spec/netsuite/records/customer_payment_credit_list_spec.rb
netsuite-0.8.7 spec/netsuite/records/customer_payment_credit_list_spec.rb