Sha256: 4380382a95ce70c07a1f9f5c42576db43fc12daeb1c5c7e030984ac52125e1d2

Contents?: true

Size: 1.41 KB

Versions: 60

Compression:

Stored size: 1.41 KB

Contents

require 'spec_helper'

describe NetSuite::Records::BillingScheduleMilestone do
  let(:milestone) { NetSuite::Records::BillingScheduleMilestone.new }

  it 'has the right fields' do
    [
      :comments, :milestone_actual_completion_date, :milestone_amount, 
      :milestone_completed, :milestone_date, :milestone_id
    ].each do |field|
      expect(milestone).to have_field(field)
    end
  end

  it 'has the right record_refs' do
    [
      :milestone_term, :project_task
    ].each do |record_ref|
      expect(milestone).to have_record_ref(record_ref)
    end
  end

  it 'can initialize from a record' do
    record = NetSuite::Records::BillingScheduleMilestone.new(:comments => "foo")
    milestone = NetSuite::Records::BillingScheduleMilestone.new(record)
    expect(milestone).to be_kind_of(NetSuite::Records::BillingScheduleMilestone)
    expect(milestone.comments).to eql("foo")
  end

  describe '#to_record' do
    before do
      milestone.comments         = 'comment'
      milestone.milestone_amount = 1
    end

    it 'can represent itself as a SOAP record' do
      record = {
        'listAcct:comments'        => 'comment',
        'listAcct:milestoneAmount' => 1
      }
      expect(milestone.to_record).to eql(record)
    end
  end

  describe '#record_type' do
    it 'returns a string of the SOAP record type' do
      expect(milestone.record_type).to eql('listAcct:BillingScheduleMilestone')
    end
  end

end

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
netsuite-0.7.6 spec/netsuite/records/billing_schedule_milestone_spec.rb
netsuite-0.7.5 spec/netsuite/records/billing_schedule_milestone_spec.rb
netsuite-0.7.4 spec/netsuite/records/billing_schedule_milestone_spec.rb
netsuite-0.7.3 spec/netsuite/records/billing_schedule_milestone_spec.rb
netsuite-0.7.2 spec/netsuite/records/billing_schedule_milestone_spec.rb
netsuite-0.7.1 spec/netsuite/records/billing_schedule_milestone_spec.rb
netsuite-0.7.0 spec/netsuite/records/billing_schedule_milestone_spec.rb
netsuite-0.6.9 spec/netsuite/records/billing_schedule_milestone_spec.rb
netsuite-0.6.8 spec/netsuite/records/billing_schedule_milestone_spec.rb
netsuite-0.6.7 spec/netsuite/records/billing_schedule_milestone_spec.rb
netsuite-0.6.6 spec/netsuite/records/billing_schedule_milestone_spec.rb
netsuite-0.6.5 spec/netsuite/records/billing_schedule_milestone_spec.rb
netsuite-0.6.4 spec/netsuite/records/billing_schedule_milestone_spec.rb
netsuite-0.6.3 spec/netsuite/records/billing_schedule_milestone_spec.rb
netsuite-0.6.2 spec/netsuite/records/billing_schedule_milestone_spec.rb
netsuite-0.6.1 spec/netsuite/records/billing_schedule_milestone_spec.rb
netsuite-0.6.0 spec/netsuite/records/billing_schedule_milestone_spec.rb
netsuite-0.5.9 spec/netsuite/records/billing_schedule_milestone_spec.rb
netsuite-0.5.8 spec/netsuite/records/billing_schedule_milestone_spec.rb
netsuite-0.5.7 spec/netsuite/records/billing_schedule_milestone_spec.rb