active_shipping 1.14.2 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -25
- data/CHANGELOG.md +5 -0
- data/CONTRIBUTING.md +2 -0
- data/README.md +2 -8
- data/active_shipping.gemspec +9 -3
- data/gemfiles/activesupport42.gemfile +0 -1
- data/lib/active_shipping.rb +1 -1
- data/lib/active_shipping/carrier.rb +2 -4
- data/lib/active_shipping/carriers/australia_post.rb +2 -4
- data/lib/active_shipping/carriers/canada_post.rb +1 -1
- data/lib/active_shipping/carriers/canada_post_pws.rb +33 -37
- data/lib/active_shipping/carriers/correios.rb +0 -2
- data/lib/active_shipping/carriers/new_zealand_post.rb +0 -2
- data/lib/active_shipping/carriers/ups.rb +0 -2
- data/lib/active_shipping/carriers/usps.rb +1 -3
- data/lib/active_shipping/external_return_label_request.rb +0 -4
- data/lib/active_shipping/location.rb +65 -52
- data/lib/active_shipping/package.rb +17 -21
- data/lib/active_shipping/package_item.rb +8 -20
- data/lib/active_shipping/rate_estimate.rb +1 -1
- data/lib/active_shipping/version.rb +1 -1
- data/test/fixtures/xml/canadapost/example_request.xml +3 -3
- data/test/helpers/holiday_helpers.rb +54 -0
- data/test/remote/australia_post_test.rb +1 -1
- data/test/remote/canada_post_pws_platform_test.rb +1 -3
- data/test/remote/canada_post_pws_test.rb +1 -1
- data/test/remote/canada_post_test.rb +1 -1
- data/test/remote/correios_test.rb +1 -2
- data/test/remote/fedex_test.rb +8 -8
- data/test/remote/kunaki_test.rb +1 -1
- data/test/remote/new_zealand_post_test.rb +1 -1
- data/test/remote/shipwire_test.rb +1 -1
- data/test/remote/stamps_test.rb +7 -7
- data/test/remote/ups_surepost_test.rb +1 -1
- data/test/remote/ups_test.rb +13 -11
- data/test/remote/usps_returns_test.rb +1 -1
- data/test/remote/usps_test.rb +5 -5
- data/test/test_helper.rb +16 -6
- data/test/unit/carrier_test.rb +25 -25
- data/test/unit/carriers/australia_post_test.rb +5 -5
- data/test/unit/carriers/benchmark_test.rb +1 -1
- data/test/unit/carriers/canada_post_pws_rating_test.rb +1 -15
- data/test/unit/carriers/canada_post_pws_register_test.rb +1 -15
- data/test/unit/carriers/canada_post_pws_shipping_test.rb +1 -13
- data/test/unit/carriers/canada_post_pws_test.rb +4 -4
- data/test/unit/carriers/canada_post_pws_tracking_test.rb +1 -1
- data/test/unit/carriers/canada_post_test.rb +9 -9
- data/test/unit/carriers/correios_test.rb +1 -2
- data/test/unit/carriers/fedex_test.rb +5 -5
- data/test/unit/carriers/kunaki_test.rb +1 -1
- data/test/unit/carriers/new_zealand_post_test.rb +9 -10
- data/test/unit/carriers/shipwire_test.rb +1 -1
- data/test/unit/carriers/stamps_test.rb +1 -1
- data/test/unit/carriers/ups_test.rb +1 -1
- data/test/unit/carriers/usps_returns_test.rb +1 -1
- data/test/unit/carriers/usps_test.rb +1 -1
- data/test/unit/carriers_test.rb +4 -5
- data/test/unit/external_return_label_request_test.rb +129 -83
- data/test/unit/location_test.rb +187 -91
- data/test/unit/package_item_test.rb +42 -47
- data/test/unit/package_test.rb +76 -75
- data/test/unit/rate_estimate_test.rb +16 -20
- data/test/unit/response_test.rb +28 -9
- data/test/unit/shipment_event_test.rb +1 -1
- data/test/unit/shipment_packer_test.rb +31 -31
- data/test/unit/tracking_response_test.rb +1 -1
- metadata +71 -23
- data/gemfiles/activesupport32.gemfile +0 -7
- data/gemfiles/activesupport32_nokogiri_17.gemfile +0 -7
- data/gemfiles/activesupport40.gemfile +0 -6
- data/gemfiles/activesupport40_nokogiri_17.gemfile +0 -6
- data/gemfiles/activesupport41.gemfile +0 -6
- data/gemfiles/activesupport41_nokogiri_17.gemfile +0 -6
- data/gemfiles/activesupport42_nokogiri_17.gemfile +0 -6
- data/test/fixtures/xml/canadapost_pws/merchant_details_response_no_contract_number.xml +0 -7
- data/test/fixtures/xml/canadapost_pws/service_options_response_priority_worldwide.xml +0 -41
@@ -1,12 +1,10 @@
|
|
1
1
|
module ActiveShipping #:nodoc:
|
2
2
|
class Package
|
3
|
-
include Quantified
|
4
|
-
|
5
3
|
cattr_accessor :default_options
|
6
4
|
attr_reader :options, :value, :currency
|
7
5
|
|
8
6
|
# Package.new(100, [10, 20, 30], :units => :metric)
|
9
|
-
# Package.new(
|
7
|
+
# Package.new(Measured::Weight.new(100, :g), [10, 20, 30].map {|m| Length.new(m, :centimetres)})
|
10
8
|
# Package.new(100.grams, [10, 20, 30].map(&:centimetres))
|
11
9
|
def initialize(grams_or_ounces, dimensions, options = {})
|
12
10
|
options = @@default_options.update(options) if @@default_options
|
@@ -15,28 +13,26 @@ module ActiveShipping #:nodoc:
|
|
15
13
|
|
16
14
|
@dimensions = [dimensions].flatten.reject(&:nil?)
|
17
15
|
|
18
|
-
imperial = (options[:units] == :imperial)
|
19
|
-
([grams_or_ounces, *dimensions].all? { |m| m.respond_to?(:unit) && m.unit.to_sym == :imperial })
|
16
|
+
imperial = (options[:units] == :imperial)
|
20
17
|
|
21
18
|
weight_imperial = dimensions_imperial = imperial if options.include?(:units)
|
22
19
|
|
23
20
|
if options.include?(:weight_units)
|
24
|
-
weight_imperial = (options[:weight_units] == :imperial)
|
25
|
-
(grams_or_ounces.respond_to?(:unit) && m.unit.to_sym == :imperial)
|
21
|
+
weight_imperial = (options[:weight_units] == :imperial)
|
26
22
|
end
|
27
23
|
|
28
24
|
if options.include?(:dim_units)
|
29
|
-
dimensions_imperial = (options[:dim_units] == :imperial)
|
30
|
-
(dimensions && dimensions.all? { |m| m.respond_to?(:unit) && m.unit.to_sym == :imperial })
|
25
|
+
dimensions_imperial = (options[:dim_units] == :imperial)
|
31
26
|
end
|
32
27
|
|
33
28
|
@weight_unit_system = weight_imperial ? :imperial : :metric
|
34
29
|
@dimensions_unit_system = dimensions_imperial ? :imperial : :metric
|
35
30
|
|
36
|
-
@weight = attribute_from_metric_or_imperial(grams_or_ounces,
|
31
|
+
@weight = attribute_from_metric_or_imperial(grams_or_ounces, Measured::Weight, @weight_unit_system, :grams, :ounces)
|
37
32
|
|
38
33
|
if @dimensions.blank?
|
39
|
-
|
34
|
+
zero_length = Measured::Length.new(0, (dimensions_imperial ? :inches : :centimetres))
|
35
|
+
@dimensions = [zero_length] * 3
|
40
36
|
else
|
41
37
|
process_dimensions
|
42
38
|
end
|
@@ -67,35 +63,35 @@ module ActiveShipping #:nodoc:
|
|
67
63
|
end
|
68
64
|
|
69
65
|
def ounces(options = {})
|
70
|
-
weight(options).
|
66
|
+
weight(options).convert_to(:oz).value.to_f
|
71
67
|
end
|
72
68
|
alias_method :oz, :ounces
|
73
69
|
|
74
70
|
def grams(options = {})
|
75
|
-
weight(options).
|
71
|
+
weight(options).convert_to(:g).value.to_f
|
76
72
|
end
|
77
73
|
alias_method :g, :grams
|
78
74
|
|
79
75
|
def pounds(options = {})
|
80
|
-
weight(options).
|
76
|
+
weight(options).convert_to(:lb).value.to_f
|
81
77
|
end
|
82
78
|
alias_method :lb, :pounds
|
83
79
|
alias_method :lbs, :pounds
|
84
80
|
|
85
81
|
def kilograms(options = {})
|
86
|
-
weight(options).
|
82
|
+
weight(options).convert_to(:kg).value.to_f
|
87
83
|
end
|
88
84
|
alias_method :kg, :kilograms
|
89
85
|
alias_method :kgs, :kilograms
|
90
86
|
|
91
87
|
def inches(measurement = nil)
|
92
|
-
@inches ||= @dimensions.map { |m| m.
|
88
|
+
@inches ||= @dimensions.map { |m| m.convert_to(:in).value.to_f }
|
93
89
|
measurement.nil? ? @inches : measure(measurement, @inches)
|
94
90
|
end
|
95
91
|
alias_method :in, :inches
|
96
92
|
|
97
93
|
def centimetres(measurement = nil)
|
98
|
-
@centimetres ||= @dimensions.map { |m| m.
|
94
|
+
@centimetres ||= @dimensions.map { |m| m.convert_to(:cm).value.to_f }
|
99
95
|
measurement.nil? ? @centimetres : measure(measurement, @centimetres)
|
100
96
|
end
|
101
97
|
alias_method :cm, :centimetres
|
@@ -106,8 +102,8 @@ module ActiveShipping #:nodoc:
|
|
106
102
|
@weight
|
107
103
|
when :volumetric, :dimensional
|
108
104
|
@volumetric_weight ||= begin
|
109
|
-
m =
|
110
|
-
@weight_unit_system == :imperial ? m.
|
105
|
+
m = Measured::Weight.new((centimetres(:box_volume) / 6.0), :grams)
|
106
|
+
@weight_unit_system == :imperial ? m.convert_to(:oz) : m
|
111
107
|
end
|
112
108
|
when :billable
|
113
109
|
[weight, weight(:type => :volumetric)].max
|
@@ -143,7 +139,7 @@ module ActiveShipping #:nodoc:
|
|
143
139
|
|
144
140
|
def measure(measurement, ary)
|
145
141
|
case measurement
|
146
|
-
when
|
142
|
+
when Integer then ary[measurement]
|
147
143
|
when :x, :max, :length, :long then ary[2]
|
148
144
|
when :y, :mid, :width, :wide then ary[1]
|
149
145
|
when :z, :min, :height, :depth, :high, :deep then ary[0]
|
@@ -156,7 +152,7 @@ module ActiveShipping #:nodoc:
|
|
156
152
|
|
157
153
|
def process_dimensions
|
158
154
|
@dimensions = @dimensions.map do |l|
|
159
|
-
attribute_from_metric_or_imperial(l, Length, @dimensions_unit_system, :centimetres, :inches)
|
155
|
+
attribute_from_metric_or_imperial(l, Measured::Length, @dimensions_unit_system, :centimetres, :inches)
|
160
156
|
end.sort
|
161
157
|
# [1,2] => [1,1,2]
|
162
158
|
# [5] => [5,5,5]
|
@@ -1,18 +1,16 @@
|
|
1
1
|
module ActiveShipping #:nodoc:
|
2
2
|
class PackageItem
|
3
|
-
include Quantified
|
4
|
-
|
5
3
|
attr_reader :sku, :hs_code, :value, :name, :weight, :quantity, :options
|
6
4
|
|
7
5
|
def initialize(name, grams_or_ounces, value, quantity, options = {})
|
8
6
|
@name = name
|
9
7
|
|
10
|
-
imperial = (options[:units] == :imperial)
|
11
|
-
(grams_or_ounces.respond_to?(:unit) && m.unit.to_sym == :imperial)
|
8
|
+
imperial = (options[:units] == :imperial)
|
12
9
|
|
13
10
|
@unit_system = imperial ? :imperial : :metric
|
14
11
|
|
15
|
-
@weight =
|
12
|
+
@weight = grams_or_ounces
|
13
|
+
@weight = Measured::Weight.new(grams_or_ounces, (@unit_system == :imperial ? :oz : :g)) unless @weight.is_a?(Measured::Weight)
|
16
14
|
|
17
15
|
@value = Package.cents_from(value)
|
18
16
|
@quantity = quantity > 0 ? quantity : 1
|
@@ -28,7 +26,7 @@ module ActiveShipping #:nodoc:
|
|
28
26
|
@weight
|
29
27
|
when :volumetric, :dimensional
|
30
28
|
@volumetric_weight ||= begin
|
31
|
-
m =
|
29
|
+
m = Measured::Weight.new((centimetres(:box_volume) / 6.0), :grams)
|
32
30
|
@unit_system == :imperial ? m.in_ounces : m
|
33
31
|
end
|
34
32
|
when :billable
|
@@ -38,35 +36,25 @@ module ActiveShipping #:nodoc:
|
|
38
36
|
alias_method :mass, :weight
|
39
37
|
|
40
38
|
def ounces(options = {})
|
41
|
-
weight(options).
|
39
|
+
weight(options).convert_to(:oz).value
|
42
40
|
end
|
43
41
|
alias_method :oz, :ounces
|
44
42
|
|
45
43
|
def grams(options = {})
|
46
|
-
weight(options).
|
44
|
+
weight(options).convert_to(:g).value
|
47
45
|
end
|
48
46
|
alias_method :g, :grams
|
49
47
|
|
50
48
|
def pounds(options = {})
|
51
|
-
weight(options).
|
49
|
+
weight(options).convert_to(:lb).value
|
52
50
|
end
|
53
51
|
alias_method :lb, :pounds
|
54
52
|
alias_method :lbs, :pounds
|
55
53
|
|
56
54
|
def kilograms(options = {})
|
57
|
-
weight(options).
|
55
|
+
weight(options).convert_to(:kg).value
|
58
56
|
end
|
59
57
|
alias_method :kg, :kilograms
|
60
58
|
alias_method :kgs, :kilograms
|
61
|
-
|
62
|
-
private
|
63
|
-
|
64
|
-
def attribute_from_metric_or_imperial(obj, klass, metric_unit, imperial_unit)
|
65
|
-
if obj.is_a?(klass)
|
66
|
-
return value
|
67
|
-
else
|
68
|
-
return klass.new(obj, (@unit_system == :imperial ? imperial_unit : metric_unit))
|
69
|
-
end
|
70
|
-
end
|
71
59
|
end
|
72
60
|
end
|
@@ -189,7 +189,7 @@ module ActiveShipping
|
|
189
189
|
# @return [Date, nil] The Date object absed on the input, or `nil` if no date
|
190
190
|
# could be determined.
|
191
191
|
def date_for(date)
|
192
|
-
date &&
|
192
|
+
date && Date.strptime(date.to_s, "%Y-%m-%d")
|
193
193
|
rescue ArgumentError
|
194
194
|
nil
|
195
195
|
end
|
@@ -10,9 +10,9 @@
|
|
10
10
|
<item>
|
11
11
|
<quantity>1</quantity>
|
12
12
|
<weight>0.5</weight>
|
13
|
-
<length>4</length>
|
14
|
-
<width>3</width>
|
15
|
-
<height>2</height>
|
13
|
+
<length>4.0</length>
|
14
|
+
<width>3.0</width>
|
15
|
+
<height>2.0</height>
|
16
16
|
<description>a box full of stuff</description>
|
17
17
|
<readyToShip/>
|
18
18
|
</item>
|
@@ -0,0 +1,54 @@
|
|
1
|
+
module HolidayHelpers
|
2
|
+
class MissingConfigurationError < RuntimeError; end
|
3
|
+
|
4
|
+
HOLIDAYS = {
|
5
|
+
ups: { # https://compass.ups.com/ups-holiday-schedule-2016/
|
6
|
+
"2016" => [
|
7
|
+
{ month: 1, day: 1 },
|
8
|
+
{ month: 5, day: 30 },
|
9
|
+
{ month: 6, day: 4 },
|
10
|
+
{ month: 9, day: 5 },
|
11
|
+
{ month: 11, day: 24 },
|
12
|
+
{ month: 12, day: 26 },
|
13
|
+
],
|
14
|
+
"2017" => [
|
15
|
+
{ month: 1, day: 2 },
|
16
|
+
{ month: 5, day: 29 },
|
17
|
+
{ month: 6, day: 4 },
|
18
|
+
{ month: 9, day: 4 },
|
19
|
+
{ month: 11, day: 23 },
|
20
|
+
{ month: 12, day: 25 },
|
21
|
+
]
|
22
|
+
}
|
23
|
+
}
|
24
|
+
|
25
|
+
def with_holidays(carrier, year=Date.current.year)
|
26
|
+
holiday_config = fetch_holidays(carrier, year)
|
27
|
+
|
28
|
+
BusinessTime::Config.with(holidays: holiday_config) do
|
29
|
+
yield
|
30
|
+
end
|
31
|
+
|
32
|
+
rescue MissingConfigurationError
|
33
|
+
self.logger.warn(
|
34
|
+
"[HolidayHelpers] Missing holiday configuration. You need to update test/helpers/holiday_helpers.rb. "\
|
35
|
+
"test: #{self}, carrier: #{carrier}, year: #{year}")
|
36
|
+
yield
|
37
|
+
end
|
38
|
+
|
39
|
+
private
|
40
|
+
|
41
|
+
def fetch_holidays(carrier, year)
|
42
|
+
carrier_holiday_config = case carrier
|
43
|
+
when :ups
|
44
|
+
HOLIDAYS[carrier]
|
45
|
+
else
|
46
|
+
raise MissingConfigurationError
|
47
|
+
end
|
48
|
+
raise MissingConfigurationError unless carrier_holiday_config.include?(year.to_s)
|
49
|
+
|
50
|
+
carrier_holiday_config[year.to_s].map do |holiday|
|
51
|
+
Date.new(year, holiday[:month], holiday[:day])
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -1,9 +1,7 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
1
|
require 'test_helper'
|
4
2
|
|
5
3
|
# All remote tests require Canada Post development environment credentials
|
6
|
-
class RemoteCanadaPostPWSPlatformTest <
|
4
|
+
class RemoteCanadaPostPWSPlatformTest < ActiveSupport::TestCase
|
7
5
|
include ActiveShipping::Test::Credentials
|
8
6
|
include ActiveShipping::Test::Fixtures
|
9
7
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
|
-
class RemoteCanadaPostPWSTest <
|
3
|
+
class RemoteCanadaPostPWSTest < ActiveSupport::TestCase
|
4
4
|
# All remote tests require Canada Post development environment credentials
|
5
5
|
include ActiveShipping::Test::Credentials
|
6
6
|
include ActiveShipping::Test::Fixtures
|
data/test/remote/fedex_test.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
|
-
class RemoteFedExTest <
|
3
|
+
class RemoteFedExTest < ActiveSupport::TestCase
|
4
4
|
include ActiveShipping::Test::Credentials
|
5
5
|
include ActiveShipping::Test::Fixtures
|
6
6
|
|
@@ -33,7 +33,7 @@ class RemoteFedExTest < Minitest::Test
|
|
33
33
|
assert response.rates.length > 0
|
34
34
|
response.rates.each do |rate|
|
35
35
|
assert_instance_of String, rate.service_name
|
36
|
-
|
36
|
+
assert_kind_of Integer, rate.price
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
@@ -75,7 +75,7 @@ class RemoteFedExTest < Minitest::Test
|
|
75
75
|
assert response.rates.length > 0
|
76
76
|
response.rates.each do |rate|
|
77
77
|
assert_instance_of String, rate.service_name
|
78
|
-
|
78
|
+
assert_kind_of Integer, rate.price
|
79
79
|
end
|
80
80
|
end
|
81
81
|
|
@@ -134,7 +134,7 @@ class RemoteFedExTest < Minitest::Test
|
|
134
134
|
assert response.rates.length > 0
|
135
135
|
response.rates.each do |rate|
|
136
136
|
assert_instance_of String, rate.service_name
|
137
|
-
|
137
|
+
assert_kind_of Integer, rate.price
|
138
138
|
end
|
139
139
|
end
|
140
140
|
|
@@ -149,7 +149,7 @@ class RemoteFedExTest < Minitest::Test
|
|
149
149
|
assert response.rates.length > 0
|
150
150
|
response.rates.each do |rate|
|
151
151
|
assert_instance_of String, rate.service_name
|
152
|
-
|
152
|
+
assert_kind_of Integer, rate.price
|
153
153
|
end
|
154
154
|
end
|
155
155
|
|
@@ -164,7 +164,7 @@ class RemoteFedExTest < Minitest::Test
|
|
164
164
|
assert response.rates.length > 0
|
165
165
|
response.rates.each do |rate|
|
166
166
|
assert_instance_of String, rate.service_name
|
167
|
-
|
167
|
+
assert_kind_of Integer, rate.price
|
168
168
|
end
|
169
169
|
end
|
170
170
|
|
@@ -179,7 +179,7 @@ class RemoteFedExTest < Minitest::Test
|
|
179
179
|
assert response.rates.length > 0
|
180
180
|
response.rates.each do |rate|
|
181
181
|
assert_instance_of String, rate.service_name
|
182
|
-
|
182
|
+
assert_kind_of Integer, rate.price
|
183
183
|
end
|
184
184
|
end
|
185
185
|
|
@@ -194,7 +194,7 @@ class RemoteFedExTest < Minitest::Test
|
|
194
194
|
assert response.rates.length > 0
|
195
195
|
response.rates.each do |rate|
|
196
196
|
assert_instance_of String, rate.service_name
|
197
|
-
|
197
|
+
assert_kind_of Integer, rate.price
|
198
198
|
end
|
199
199
|
end
|
200
200
|
|
data/test/remote/kunaki_test.rb
CHANGED
data/test/remote/stamps_test.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
|
-
class RemoteStampsTest <
|
3
|
+
class RemoteStampsTest < ActiveSupport::TestCase
|
4
4
|
include ActiveShipping::Test::Credentials
|
5
5
|
include ActiveShipping::Test::Fixtures
|
6
6
|
|
@@ -138,7 +138,7 @@ class RemoteStampsTest < Minitest::Test
|
|
138
138
|
assert_equal '10017', response.rate.destination.zip
|
139
139
|
assert_equal 'US', response.rate.destination.country_code
|
140
140
|
|
141
|
-
|
141
|
+
assert_kind_of Integer, response.rate.total_price
|
142
142
|
assert_instance_of String, response.stamps_tx_id
|
143
143
|
|
144
144
|
assert_nil response.label_url
|
@@ -169,7 +169,7 @@ class RemoteStampsTest < Minitest::Test
|
|
169
169
|
assert_equal 'K1P 1J1', response.rate.destination.zip
|
170
170
|
assert_equal 'CA', response.rate.destination.country_code
|
171
171
|
|
172
|
-
|
172
|
+
assert_kind_of Integer, response.rate.total_price
|
173
173
|
assert_instance_of String, response.stamps_tx_id
|
174
174
|
assert_instance_of String, response.label_url
|
175
175
|
|
@@ -299,8 +299,8 @@ class RemoteStampsTest < Minitest::Test
|
|
299
299
|
rate = response.rates.first
|
300
300
|
assert_equal 'Stamps', rate.carrier
|
301
301
|
assert_equal 'USD', rate.currency
|
302
|
-
|
303
|
-
|
302
|
+
assert_kind_of Integer, rate.total_price
|
303
|
+
assert_kind_of Integer, rate.price
|
304
304
|
assert_instance_of String, rate.service_name
|
305
305
|
assert_instance_of String, rate.service_code
|
306
306
|
assert_instance_of Array, rate.package_rates
|
@@ -328,8 +328,8 @@ class RemoteStampsTest < Minitest::Test
|
|
328
328
|
rate = response.rates.first
|
329
329
|
assert_equal 'Stamps', rate.carrier
|
330
330
|
assert_equal 'USD', rate.currency
|
331
|
-
|
332
|
-
|
331
|
+
assert_kind_of Integer, rate.total_price
|
332
|
+
assert_kind_of Integer, rate.price
|
333
333
|
assert_instance_of String, rate.service_name
|
334
334
|
assert_instance_of String, rate.service_code
|
335
335
|
assert_instance_of Array, rate.package_rates
|