Sha256: a1bca43c7314b27f7c67972163f696cfbbfc4b6ce76f22df55c296f14bb43bbf

Contents?: true

Size: 977 Bytes

Versions: 47

Compression:

Stored size: 977 Bytes

Contents

require 'spec_helper'

describe NetSuite::Records::ShipAddress do
  let(:ship_address) { NetSuite::Records::ShipAddress.new }

  it 'has all the right fields' do
    [
      :ship_attention, :ship_addressee, :ship_phone, :ship_addr1, :ship_addr2, :ship_addr3,
      :ship_city, :ship_state, :ship_zip, :ship_country, :ship_is_residential
    ].each do |field|
      ship_address.should have_field(field)
    end
  end

  describe '#to_record' do
    before do
      ship_address.ship_attention = 'Mr. Smith'
      ship_address.ship_zip       = '90007'
    end

    it 'can represent itself as a SOAP record' do
      record = {
        'platformCommon:shipAttention' => 'Mr. Smith',
        'platformCommon:shipZip'       => '90007'
      }
      ship_address.to_record.should eql(record)
    end
  end

  describe '#record_type' do
    it 'returns a string of the SOAP record type' do
      ship_address.record_type.should eql('platformCommon:ShipAddress')
    end
  end

end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
netsuite-0.0.17 spec/netsuite/records/ship_address_spec.rb
netsuite-0.0.16 spec/netsuite/records/ship_address_spec.rb
netsuite-0.0.15 spec/netsuite/records/ship_address_spec.rb
netsuite-0.0.14 spec/netsuite/records/ship_address_spec.rb
netsuite-0.0.13 spec/netsuite/records/ship_address_spec.rb
netsuite-0.0.12 spec/netsuite/records/ship_address_spec.rb
netsuite-0.0.11 spec/netsuite/records/ship_address_spec.rb