Module: USPS::Test::AddressVerification

Included in:
USPS::Test
Defined in:
lib/usps/test/address_verification.rb

Instance Method Summary collapse

Instance Method Details

#test_address_standardization_1Object



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/usps/test/address_verification.rb', line 3

def test_address_standardization_1
  address = USPS::Address.new(
    :address => '6406 Ivy Lane',
    :city => 'Greenbelt',
    :state => 'MD'
  ).standardize!
  
  assert_equal '6406 IVY LN', address.address
  assert_equal 'GREENBELT', address.city
  assert_equal 'MD', address.state
  assert_equal '20770', address.zip5
  assert_equal '1440', address.zip4
end

#test_address_standardization_2Object



17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/usps/test/address_verification.rb', line 17

def test_address_standardization_2
  address = USPS::Address.new(
    :address => '8 Wildwood Drive',
    :city => 'Old Lyme',
    :state => 'CT'
  ).standardize!

  assert_equal '8 WILDWOOD DR', address.address
  assert_equal 'OLD LYME', address.city
  assert_equal 'CT', address.state
  assert_equal '06371', address.zip5
  assert_equal '1844', address.zip4
end