active_shipping 0.1.4 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +2 -0
- data/README.markdown +0 -3
- data/lib/active_merchant/common.rb +14 -0
- data/lib/{active_shipping/lib → active_merchant/common}/connection.rb +2 -0
- data/lib/{active_shipping/lib → active_merchant/common}/country.rb +0 -0
- data/lib/active_merchant/common/error.rb +26 -0
- data/lib/active_merchant/common/post_data.rb +24 -0
- data/lib/{active_shipping/lib → active_merchant/common}/posts_data.rb +0 -0
- data/lib/{active_shipping/lib → active_merchant/common}/requires_parameters.rb +0 -0
- data/lib/{active_shipping/lib → active_merchant/common}/utils.rb +0 -0
- data/lib/{active_shipping/lib → active_merchant/common}/validateable.rb +0 -0
- data/lib/active_shipping.rb +10 -22
- data/lib/active_shipping/shipping/base.rb +2 -1
- data/lib/active_shipping/shipping/carrier.rb +0 -5
- data/lib/active_shipping/shipping/carriers.rb +2 -1
- data/lib/active_shipping/shipping/carriers/fedex.rb +7 -191
- data/lib/active_shipping/shipping/carriers/kunaki.rb +165 -0
- data/lib/active_shipping/shipping/carriers/ups.rb +2 -1
- data/lib/active_shipping/shipping/carriers/usps.rb +0 -85
- data/lib/active_shipping/shipping/location.rb +1 -4
- data/lib/active_shipping/shipping/response.rb +1 -4
- data/lib/active_shipping/version.rb +3 -0
- data/lib/vendor/quantified/lib/quantified.rb +5 -3
- metadata +68 -102
- data/.gitignore +0 -8
- data/Rakefile +0 -51
- data/VERSION +0 -1
- data/active_shipping.gemspec +0 -152
- data/init.rb +0 -1
- data/lib/active_shipping/lib/error.rb +0 -4
- data/lib/active_shipping/lib/post_data.rb +0 -22
- data/lib/active_shipping/shipping/contact.rb +0 -18
- data/lib/active_shipping/shipping/label.rb +0 -31
- data/lib/active_shipping/shipping/location_response.rb +0 -14
- data/lib/active_shipping/shipping/party.rb +0 -15
- data/lib/active_shipping/shipping/return_label_response.rb +0 -14
- data/lib/active_shipping/shipping/return_shipment.rb +0 -14
- data/lib/active_shipping/shipping/shipment.rb +0 -73
- data/test/fixtures.example.yml +0 -13
- data/test/fixtures/xml/fedex/ottawa_to_beverly_hills_rate_request.xml +0 -67
- data/test/fixtures/xml/fedex/ottawa_to_beverly_hills_rate_response.xml +0 -213
- data/test/fixtures/xml/fedex/tracking_request.xml +0 -27
- data/test/fixtures/xml/fedex/tracking_response.xml +0 -153
- data/test/fixtures/xml/shipwire/international_rates_response.xml +0 -17
- data/test/fixtures/xml/shipwire/invalid_credentials_response.xml +0 -4
- data/test/fixtures/xml/shipwire/new_carrier_rate_response.xml +0 -18
- data/test/fixtures/xml/shipwire/no_rates_response.xml +0 -7
- data/test/fixtures/xml/shipwire/rates_response.xml +0 -36
- data/test/fixtures/xml/ups/example_tracking_response.xml +0 -53
- data/test/fixtures/xml/ups/shipment_from_tiger_direct.xml +0 -222
- data/test/fixtures/xml/ups/test_real_home_as_residential_destination_response.xml +0 -1
- data/test/fixtures/xml/usps/beverly_hills_to_ottawa_book_rate_response.xml +0 -85
- data/test/fixtures/xml/usps/beverly_hills_to_ottawa_book_wii_rate_response.xml +0 -168
- data/test/fixtures/xml/usps/beverly_hills_to_ottawa_wii_rate_response.xml +0 -85
- data/test/fixtures/xml/usps/example_tracking_response.xml +0 -104
- data/test/fixtures/xml/usps/multi_tracking_example.xml +0 -105
- data/test/party_factory.rb +0 -29
- data/test/remote/fedex_test.rb +0 -160
- data/test/remote/shipwire_test.rb +0 -88
- data/test/remote/ups_test.rb +0 -207
- data/test/remote/usps_test.rb +0 -184
- data/test/shipment_factory.rb +0 -27
- data/test/test_helper.rb +0 -171
- data/test/unit/base_test.rb +0 -18
- data/test/unit/carriers/fedex_test.rb +0 -78
- data/test/unit/carriers/shipwire_test.rb +0 -130
- data/test/unit/carriers/ups_test.rb +0 -81
- data/test/unit/carriers/usps_test.rb +0 -206
- data/test/unit/location_test.rb +0 -46
- data/test/unit/package_test.rb +0 -65
- data/test/unit/party_test.rb +0 -20
- data/test/unit/response_test.rb +0 -10
- data/test/unit/shipment_test.rb +0 -43
@@ -1,206 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../test_helper'
|
2
|
-
|
3
|
-
class USPSTest < Test::Unit::TestCase
|
4
|
-
|
5
|
-
def setup
|
6
|
-
@packages = TestFixtures.packages
|
7
|
-
@locations = TestFixtures.locations
|
8
|
-
@carrier = USPS.new(:login => 'login')
|
9
|
-
@international_rate_responses = {
|
10
|
-
:vanilla => xml_fixture('usps/beverly_hills_to_ottawa_book_rate_response')
|
11
|
-
}
|
12
|
-
|
13
|
-
end
|
14
|
-
|
15
|
-
# TODO: test_parse_domestic_rate_response
|
16
|
-
# TODO: test_build_us_rate_request
|
17
|
-
# TODO: test_build_world_rate_request
|
18
|
-
|
19
|
-
def test_initialize_options_requirements
|
20
|
-
assert_raises ArgumentError do USPS.new end
|
21
|
-
assert_nothing_raised { USPS.new(:login => 'blah')}
|
22
|
-
end
|
23
|
-
|
24
|
-
def test_find_tracking_info_should_return_a_tracking_response
|
25
|
-
@carrier.expects(:commit).returns(xml_fixture('usps/example_tracking_response'))
|
26
|
-
assert_instance_of ActiveMerchant::Shipping::TrackingResponse,
|
27
|
-
@carrier.find_tracking_info(['EJ958083578US'], :test => true)[0]
|
28
|
-
end
|
29
|
-
|
30
|
-
def test_find_tracking_info_should_return_a_tracking_number
|
31
|
-
@carrier.expects(:commit).returns(xml_fixture('usps/example_tracking_response'))
|
32
|
-
info = @carrier.find_tracking_info(['EJ958083578US'], :test => true)[0]
|
33
|
-
|
34
|
-
assert_equal 'EJ958083578US', info.tracking_number
|
35
|
-
end
|
36
|
-
|
37
|
-
def test_find_tracking_info_should_return_correct_number_of_shipment_events
|
38
|
-
@carrier.expects(:commit).returns(xml_fixture('usps/example_tracking_response'))
|
39
|
-
info = @carrier.find_tracking_info(['EJ958083578US'], :test => true)[0]
|
40
|
-
|
41
|
-
assert_equal 4, info.shipment_events.size
|
42
|
-
end
|
43
|
-
|
44
|
-
def test_find_tracking_info_should_return_proper_order
|
45
|
-
@carrier.expects(:commit).returns(xml_fixture('usps/example_tracking_response'))
|
46
|
-
info = @carrier.find_tracking_info(['EJ958083578US'], :test => true)[0]
|
47
|
-
|
48
|
-
assert_equal "NOTICE LEFT", info.shipment_events.first.name
|
49
|
-
assert_equal "DELIVERED", info.shipment_events.last.name
|
50
|
-
end
|
51
|
-
|
52
|
-
def test_find_multiple_returns_two_seperate_tracking_responses
|
53
|
-
@carrier.expects(:commit).returns(xml_fixture('usps/multi_tracking_example'))
|
54
|
-
info = @carrier.find_tracking_info(['EJ958083578US', 'EJ958088694US'], :test => true)
|
55
|
-
assert_equal 2, info.size
|
56
|
-
assert_equal 'EJ958083578US', info.first.tracking_number
|
57
|
-
assert_equal 'EJ958088694US', info.last.tracking_number
|
58
|
-
end
|
59
|
-
|
60
|
-
def test_parse_international_rate_response
|
61
|
-
fixture_xml = @international_rate_responses[:vanilla]
|
62
|
-
@carrier.expects(:commit).returns(fixture_xml)
|
63
|
-
|
64
|
-
response = begin
|
65
|
-
@carrier.find_rates(
|
66
|
-
@locations[:beverly_hills], # imperial (U.S. origin)
|
67
|
-
@locations[:ottawa],
|
68
|
-
@packages[:book],
|
69
|
-
:test => true
|
70
|
-
)
|
71
|
-
rescue ResponseError => e
|
72
|
-
e.response
|
73
|
-
end
|
74
|
-
|
75
|
-
|
76
|
-
expected_xml_hash = Hash.from_xml(fixture_xml)
|
77
|
-
actual_xml_hash = Hash.from_xml(response.xml)
|
78
|
-
|
79
|
-
assert_equal expected_xml_hash, actual_xml_hash
|
80
|
-
|
81
|
-
assert_not_equal [],response.rates
|
82
|
-
assert_equal response.rates.sort_by(&:price), response.rates
|
83
|
-
assert_equal ["1", "2", "3", "4", "6", "7", "9"], response.rates.map(&:service_code).sort
|
84
|
-
|
85
|
-
ordered_service_names = ["USPS Express Mail International (EMS)", "USPS First-Class Mail International", "USPS Global Express Guaranteed", "USPS Global Express Guaranteed Non-Document Non-Rectangular", "USPS Global Express Guaranteed Non-Document Rectangular", "USPS Priority Mail International", "USPS Priority Mail International Flat Rate Box"]
|
86
|
-
assert_equal ordered_service_names, response.rates.map(&:service_name).sort
|
87
|
-
|
88
|
-
|
89
|
-
assert_equal [376, 1600, 2300, 2325, 4100, 4100, 4100], response.rates.map(&:total_price)
|
90
|
-
end
|
91
|
-
|
92
|
-
def test_parse_max_dimension_sentences
|
93
|
-
limits = {
|
94
|
-
"Max. length 46\", width 35\", height 46\" and max. length plus girth 108\"" =>
|
95
|
-
[{:length => 46.0, :width => 46.0, :height => 35.0, :length_plus_girth => 108.0}],
|
96
|
-
"Max.length 42\", max. length plus girth 79\"" =>
|
97
|
-
[{:length => 42.0, :length_plus_girth => 79.0}],
|
98
|
-
"9 1/2\" X 12 1/2\"" =>
|
99
|
-
[{:length => 12.5, :width => 9.5, :height => 0.75}, "Flat Rate Envelope"],
|
100
|
-
"Maximum length and girth combined 108\"" =>
|
101
|
-
[{:length_plus_girth => 108.0}],
|
102
|
-
"USPS-supplied Priority Mail flat-rate envelope 9 1/2\" x 12 1/2.\" Maximum weight 4 pounds." =>
|
103
|
-
[{:length => 12.5, :width => 9.5, :height => 0.75}, "Flat Rate Envelope"],
|
104
|
-
"Max. length 24\", Max. length, height, depth combined 36\"" =>
|
105
|
-
[{:length => 24.0, :length_plus_width_plus_height => 36.0}]
|
106
|
-
}
|
107
|
-
p = @packages[:book]
|
108
|
-
limits.each do |sentence,hashes|
|
109
|
-
dimensions = hashes[0].update(:weight => 50.0)
|
110
|
-
service_node = build_service_node(
|
111
|
-
:name => hashes[1],
|
112
|
-
:max_weight => 50,
|
113
|
-
:max_dimensions => sentence )
|
114
|
-
@carrier.expects(:package_valid_for_max_dimensions).with(p, dimensions)
|
115
|
-
@carrier.send(:package_valid_for_service, p, service_node)
|
116
|
-
end
|
117
|
-
|
118
|
-
service_node = build_service_node(
|
119
|
-
:name => "flat-rate box",
|
120
|
-
:max_weight => 50,
|
121
|
-
:max_dimensions => "USPS-supplied Priority Mail flat-rate box. Maximum weight 20 pounds." )
|
122
|
-
|
123
|
-
# should test against either kind of flat rate box:
|
124
|
-
dimensions = [{:weight => 50.0, :length => 11.0, :width => 8.5, :height => 5.5}, # or...
|
125
|
-
{:weight => 50.0, :length => 13.625, :width => 11.875, :height => 3.375}]
|
126
|
-
@carrier.expects(:package_valid_for_max_dimensions).with(p, dimensions[0])
|
127
|
-
@carrier.expects(:package_valid_for_max_dimensions).with(p, dimensions[1])
|
128
|
-
@carrier.send(:package_valid_for_service, p, service_node)
|
129
|
-
|
130
|
-
end
|
131
|
-
|
132
|
-
def test_package_valid_for_max_dimensions
|
133
|
-
p = Package.new(70 * 16, [10,10,10], :units => :imperial)
|
134
|
-
limits = {:weight => 70.0, :length => 10.0, :width => 10.0, :height => 10.0, :length_plus_girth => 50.0, :length_plus_width_plus_height => 30.0}
|
135
|
-
assert_equal true, @carrier.send(:package_valid_for_max_dimensions, p, limits)
|
136
|
-
|
137
|
-
limits.keys.each do |key|
|
138
|
-
dimensions = {key => (limits[key] - 1)}
|
139
|
-
assert_equal false, @carrier.send(:package_valid_for_max_dimensions, p, dimensions)
|
140
|
-
end
|
141
|
-
|
142
|
-
end
|
143
|
-
|
144
|
-
def test_strip_9_digit_zip_codes
|
145
|
-
request = URI.decode(@carrier.send(:build_us_rate_request, @packages[:book], "90210-1234", "123456789"))
|
146
|
-
assert !(request =~ /\>90210-1234\</)
|
147
|
-
assert request =~ /\>90210\</
|
148
|
-
assert !(request =~ /\>123456789\</)
|
149
|
-
assert request =~ /\>12345\</
|
150
|
-
end
|
151
|
-
|
152
|
-
def test_xml_logging_to_file
|
153
|
-
mock_response = @international_rate_responses[:vanilla]
|
154
|
-
@carrier.expects(:commit).times(2).returns(mock_response)
|
155
|
-
@carrier.find_rates(
|
156
|
-
@locations[:beverly_hills],
|
157
|
-
@locations[:ottawa],
|
158
|
-
@packages[:book],
|
159
|
-
:test => true
|
160
|
-
)
|
161
|
-
@carrier.find_rates(
|
162
|
-
@locations[:beverly_hills],
|
163
|
-
@locations[:ottawa],
|
164
|
-
@packages[:book],
|
165
|
-
:test => true
|
166
|
-
)
|
167
|
-
end
|
168
|
-
|
169
|
-
def test_maximum_weight
|
170
|
-
assert Package.new(70 * 16, [5,5,5], :units => :imperial).mass == @carrier.maximum_weight
|
171
|
-
assert Package.new((70 * 16) + 0.01, [5,5,5], :units => :imperial).mass > @carrier.maximum_weight
|
172
|
-
assert Package.new((70 * 16) - 0.01, [5,5,5], :units => :imperial).mass < @carrier.maximum_weight
|
173
|
-
end
|
174
|
-
|
175
|
-
private
|
176
|
-
|
177
|
-
def build_service_node(options = {})
|
178
|
-
XmlNode.new('Service') do |service_node|
|
179
|
-
service_node << XmlNode.new('Pounds', options[:pounds] || "0")
|
180
|
-
service_node << XmlNode.new('SvcCommitments', options[:svc_commitments] || "Varies")
|
181
|
-
service_node << XmlNode.new('Country', options[:country] || "CANADA")
|
182
|
-
service_node << XmlNode.new('ID', options[:id] || "3")
|
183
|
-
service_node << XmlNode.new('MaxWeight', options[:max_weight] || "64")
|
184
|
-
service_node << XmlNode.new('SvcDescription', options[:name] || "First-Class Mail International")
|
185
|
-
service_node << XmlNode.new('MailType', options[:mail_type] || "Package")
|
186
|
-
service_node << XmlNode.new('Postage', options[:postage] || "3.76")
|
187
|
-
service_node << XmlNode.new('Ounces', options[:ounces] || "9")
|
188
|
-
service_node << XmlNode.new('MaxDimensions', options[:max_dimensions] ||
|
189
|
-
"Max. length 24\", Max. length, height, depth combined 36\"")
|
190
|
-
end.to_xml_element
|
191
|
-
end
|
192
|
-
|
193
|
-
def build_service_hash(options = {})
|
194
|
-
{"Pounds"=> options[:pounds] || "0", # 8
|
195
|
-
"SvcCommitments"=> options[:svc_commitments] || "Varies",
|
196
|
-
"Country"=> options[:country] || "CANADA",
|
197
|
-
"ID"=> options[:id] || "3",
|
198
|
-
"MaxWeight"=> options[:max_weight] || "64",
|
199
|
-
"SvcDescription"=> options[:name] || "First-Class Mail International",
|
200
|
-
"MailType"=> options[:mail_type] || "Package",
|
201
|
-
"Postage"=> options[:postage] || "3.76",
|
202
|
-
"Ounces"=> options[:ounces] || "9",
|
203
|
-
"MaxDimensions"=> options[:max_dimensions] ||
|
204
|
-
"Max. length 24\", Max. length, height, depth combined 36\""}
|
205
|
-
end
|
206
|
-
end
|
data/test/unit/location_test.rb
DELETED
@@ -1,46 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../test_helper'
|
2
|
-
|
3
|
-
class LocationTest < Test::Unit::TestCase
|
4
|
-
include ActiveMerchant::Shipping
|
5
|
-
|
6
|
-
def setup
|
7
|
-
@locations = TestFixtures.locations.dup
|
8
|
-
end
|
9
|
-
|
10
|
-
def test_countries
|
11
|
-
assert_instance_of ActiveMerchant::Country, @locations[:ottawa].country
|
12
|
-
assert_equal 'CA', @locations[:ottawa].country_code(:alpha2)
|
13
|
-
end
|
14
|
-
|
15
|
-
def test_location_from_strange_hash
|
16
|
-
hash = { :country => 'CA',
|
17
|
-
:zip => '90210',
|
18
|
-
:territory_code => 'QC',
|
19
|
-
:town => 'Perth',
|
20
|
-
:address => '66 Gregory Ave.',
|
21
|
-
:phone => '515-555-1212',
|
22
|
-
:fax_number => 'none to speak of',
|
23
|
-
:address_type => :commercial
|
24
|
-
}
|
25
|
-
location = Location.from(hash)
|
26
|
-
|
27
|
-
assert_equal hash[:country], location.country_code(:alpha2)
|
28
|
-
assert_equal hash[:zip], location.zip
|
29
|
-
assert_equal hash[:territory_code], location.province
|
30
|
-
assert_equal hash[:town], location.city
|
31
|
-
assert_equal hash[:address], location.address1
|
32
|
-
assert_equal hash[:phone], location.phone
|
33
|
-
assert_equal hash[:fax_number], location.fax
|
34
|
-
assert_equal hash[:address_type].to_s, location.address_type
|
35
|
-
end
|
36
|
-
|
37
|
-
def to_s
|
38
|
-
expected = "110 Laurier Avenue West\nOttawa, ON, K1P 1J1\nCanada"
|
39
|
-
assert_equal expected, @locations[:ottawa].to_s
|
40
|
-
end
|
41
|
-
|
42
|
-
def test_inspect
|
43
|
-
expected = "110 Laurier Avenue West\nOttawa, ON, K1P 1J1\nCanada\nPhone: 1-613-580-2400\nFax: 1-613-580-2495"
|
44
|
-
assert_equal expected, @locations[:ottawa].inspect
|
45
|
-
end
|
46
|
-
end
|
data/test/unit/package_test.rb
DELETED
@@ -1,65 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../test_helper'
|
2
|
-
|
3
|
-
class PackageTest < Test::Unit::TestCase
|
4
|
-
|
5
|
-
GRAMS_IN_AN_OUNCE = 28.349523125
|
6
|
-
OUNCES_IN_A_GRAM = 0.0352739619495804
|
7
|
-
INCHES_IN_A_CM = 0.393700787401575
|
8
|
-
CM_IN_AN_INCH = 2.54
|
9
|
-
|
10
|
-
def setup
|
11
|
-
@imperial_package = Package.new(65, [3,6,8.5],
|
12
|
-
:units => :imperial,
|
13
|
-
:value => 10.65,
|
14
|
-
:currency => 'USD'
|
15
|
-
)
|
16
|
-
|
17
|
-
@metric_package = Package.new(100, [5,18.5,40],
|
18
|
-
:value => 860,
|
19
|
-
:currency => 'CAD'
|
20
|
-
)
|
21
|
-
|
22
|
-
@packages = TestFixtures.packages
|
23
|
-
end
|
24
|
-
|
25
|
-
def test_accessors
|
26
|
-
# :wii => Package.new((7.5 * 16), [15, 10, 4.5], :units => :imperial, :value => 269.99, :currency => 'GBP')
|
27
|
-
wii = @packages[:wii]
|
28
|
-
[:x, :max, :long, :length].each do |sym|
|
29
|
-
assert_equal 15, wii.inches(sym)
|
30
|
-
assert_equal 15, wii.in(sym)
|
31
|
-
assert_equal 15 * CM_IN_AN_INCH, wii.centimetres(sym)
|
32
|
-
assert_equal 15 * CM_IN_AN_INCH, wii.cm(sym)
|
33
|
-
end
|
34
|
-
[:y, :mid, :width, :wide].each do |sym|
|
35
|
-
assert_equal 10, wii.inches(sym)
|
36
|
-
assert_equal 10, wii.in(sym)
|
37
|
-
assert_equal 10 * CM_IN_AN_INCH, wii.centimetres(sym)
|
38
|
-
assert_equal 10 * CM_IN_AN_INCH, wii.cm(sym)
|
39
|
-
end
|
40
|
-
[:z, :min, :height, :high, :depth, :deep].each do |sym|
|
41
|
-
assert_equal 4.5, wii.inches(sym)
|
42
|
-
assert_equal 4.5, wii.in(sym)
|
43
|
-
assert_equal 4.5 * CM_IN_AN_INCH, wii.centimetres(sym)
|
44
|
-
assert_equal 4.5 * CM_IN_AN_INCH, wii.cm(sym)
|
45
|
-
end
|
46
|
-
[:pounds, :lbs, :lb].each do |sym|
|
47
|
-
assert_equal 7.5, wii.send(sym)
|
48
|
-
end
|
49
|
-
[:ounces, :oz].each do |sym|
|
50
|
-
assert_equal 120, wii.send(sym)
|
51
|
-
end
|
52
|
-
[:grams, :g].each do |sym|
|
53
|
-
assert_equal 120 * GRAMS_IN_AN_OUNCE, wii.send(sym)
|
54
|
-
end
|
55
|
-
[:kilograms, :kgs, :kg].each do |sym|
|
56
|
-
assert_equal 120 * GRAMS_IN_AN_OUNCE / 1000, wii.send(sym)
|
57
|
-
end
|
58
|
-
assert_equal 675.0, wii.inches(:volume)
|
59
|
-
assert_equal 675.0, wii.inches(:box_volume)
|
60
|
-
|
61
|
-
|
62
|
-
assert_equal 'GBP', wii.currency
|
63
|
-
assert_equal 26999, wii.value
|
64
|
-
end
|
65
|
-
end
|
data/test/unit/party_test.rb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class ActiveMerchant::Shipping::PartyTest < Test::Unit::TestCase
|
4
|
-
include ActiveMerchant::Shipping
|
5
|
-
def setup
|
6
|
-
@party = PartyFactory.build(:fedex)
|
7
|
-
end
|
8
|
-
|
9
|
-
def test_has_location
|
10
|
-
assert_not_nil @party.location
|
11
|
-
end
|
12
|
-
|
13
|
-
def test_has_contact
|
14
|
-
assert_not_nil @party.contact
|
15
|
-
end
|
16
|
-
|
17
|
-
def test_has_account_number
|
18
|
-
assert_not_nil @party.account_number
|
19
|
-
end
|
20
|
-
end
|
data/test/unit/response_test.rb
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../test_helper'
|
2
|
-
|
3
|
-
class ResponseTest < Test::Unit::TestCase
|
4
|
-
def test_initialize
|
5
|
-
assert_nothing_raised do
|
6
|
-
RateResponse.new(true, "success!", {:rate => 'Free!'}, :rates => [stub(:service_name => 'Free!', :total_price => 0)], :xml => "<rate>Free!</rate>")
|
7
|
-
end
|
8
|
-
|
9
|
-
end
|
10
|
-
end
|
data/test/unit/shipment_test.rb
DELETED
@@ -1,43 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class ShipmentTest < Test::Unit::TestCase
|
4
|
-
def setup
|
5
|
-
@shipment = ShipmentFactory.build(:fedex)
|
6
|
-
end
|
7
|
-
|
8
|
-
def test_should_have_ship_at
|
9
|
-
assert_not_nil @shipment.ship_at
|
10
|
-
end
|
11
|
-
|
12
|
-
def test_should_have_service
|
13
|
-
assert_not_nil @shipment.service
|
14
|
-
end
|
15
|
-
|
16
|
-
def test_should_have_valid_service
|
17
|
-
end
|
18
|
-
|
19
|
-
def test_should_have_packaging_type
|
20
|
-
assert_not_nil @shipment.packaging_type
|
21
|
-
end
|
22
|
-
|
23
|
-
def test_should_have_shipper
|
24
|
-
assert_not_nil @shipment.shipper
|
25
|
-
end
|
26
|
-
|
27
|
-
def test_should_have_recipient
|
28
|
-
assert_not_nil @shipment.recipient
|
29
|
-
end
|
30
|
-
|
31
|
-
def test_should_have_payment_type
|
32
|
-
assert_not_nil @shipment.payment_type
|
33
|
-
end
|
34
|
-
|
35
|
-
def test_should_have_label
|
36
|
-
assert_not_nil @shipment.label
|
37
|
-
end
|
38
|
-
|
39
|
-
def test_should_have_requested_packages
|
40
|
-
assert_not_nil @shipment.requested_packages
|
41
|
-
end
|
42
|
-
|
43
|
-
end
|