easypost 2.1.0 → 2.2.0
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.
- checksums.yaml +5 -13
- data/.gitignore +2 -1
- data/CHANGELOG +83 -0
- data/README.md +19 -12
- data/VERSION +1 -1
- data/easypost.gemspec +2 -2
- data/lib/easypost/address.rb +27 -7
- data/lib/easypost/carrier_account.rb +8 -0
- data/lib/easypost/error.rb +18 -8
- data/lib/easypost/insurance.rb +4 -0
- data/lib/easypost/object.rb +36 -7
- data/lib/easypost/pickup.rb +6 -0
- data/lib/easypost/print_job.rb +6 -0
- data/lib/easypost/printer.rb +28 -0
- data/lib/easypost/resource.rb +11 -1
- data/lib/easypost/shipment.rb +7 -0
- data/lib/easypost/tracker.rb +10 -0
- data/lib/easypost/user.rb +49 -0
- data/lib/easypost/util.rb +21 -7
- data/lib/easypost/version.rb +1 -1
- data/lib/easypost.rb +11 -3
- data/spec/address_spec.rb +32 -20
- data/spec/batch_spec.rb +20 -33
- data/spec/carrier_account_spec.rb +121 -0
- data/spec/container_spec.rb +0 -11
- data/spec/insurance_spec.rb +69 -0
- data/spec/item_spec.rb +104 -101
- data/spec/order_spec.rb +1 -87
- data/spec/pickup_spec.rb +33 -19
- data/spec/shipment_spec.rb +63 -21
- data/spec/spec_helper.rb +6 -92
- data/spec/support/constant.rb +97 -0
- data/spec/tracker_spec.rb +94 -0
- data/spec/user_spec.rb +88 -0
- metadata +26 -31
- data/spec/fedex/domestic_spec.rb +0 -180
- data/spec/fedex/international_spec.rb +0 -64
- data/spec/ups/domestic_spec.rb +0 -79
- data/spec/ups/international_spec.rb +0 -64
- data/spec/usps/domestic_spec.rb +0 -66
- data/spec/usps/electronic_merchandise_returns.rb +0 -94
- data/spec/usps/merchant_returns.rb +0 -0
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
# require 'spec_helper'
|
|
2
|
-
|
|
3
|
-
# describe 'usps electronic merchandise return service' do
|
|
4
|
-
# before(:all) do
|
|
5
|
-
# @first = EasyPost::Shipment.create(
|
|
6
|
-
# :to_address => ADDRESS[:california],
|
|
7
|
-
# :from_address => ADDRESS[:missouri],
|
|
8
|
-
# :parcel => PARCEL[:dimensions_light],
|
|
9
|
-
# :is_return => true
|
|
10
|
-
# )
|
|
11
|
-
# @first.buy(:rate => @first.lowest_rate("USPSElectronicMerchandiseReturn",
|
|
12
|
-
# "First"))
|
|
13
|
-
|
|
14
|
-
# @priority = EasyPost::Shipment.create(
|
|
15
|
-
# :to_address => ADDRESS[:california],
|
|
16
|
-
# :from_address => ADDRESS[:missouri],
|
|
17
|
-
# :parcel => PARCEL[:dimensions],
|
|
18
|
-
# :is_return => true
|
|
19
|
-
# )
|
|
20
|
-
# @priority.buy(:rate => @priority.lowest_rate("USPSElectronicMerchandiseReturn",
|
|
21
|
-
# "Priority"))
|
|
22
|
-
|
|
23
|
-
# @bpm = EasyPost::Shipment.create(
|
|
24
|
-
# :to_address => ADDRESS[:california],
|
|
25
|
-
# :from_address => ADDRESS[:missouri],
|
|
26
|
-
# :parcel => PARCEL[:dimensions_light],
|
|
27
|
-
# :is_return => true
|
|
28
|
-
# )
|
|
29
|
-
# @bpm.buy(:rate => @bpm.lowest_rate("USPSElectronicMerchandiseReturn",
|
|
30
|
-
# "BoundPrintedMatter"))
|
|
31
|
-
|
|
32
|
-
# @media = EasyPost::Shipment.create(
|
|
33
|
-
# :to_address => ADDRESS[:california],
|
|
34
|
-
# :from_address => ADDRESS[:missouri],
|
|
35
|
-
# :parcel => PARCEL[:dimensions],
|
|
36
|
-
# :is_return => true
|
|
37
|
-
# )
|
|
38
|
-
# @media.buy(:rate => @media.lowest_rate("USPSElectronicMerchandiseReturn",
|
|
39
|
-
# "MediaMail"))
|
|
40
|
-
|
|
41
|
-
# @library = EasyPost::Shipment.create(
|
|
42
|
-
# :to_address => ADDRESS[:california],
|
|
43
|
-
# :from_address => ADDRESS[:missouri],
|
|
44
|
-
# :parcel => PARCEL[:dimensions],
|
|
45
|
-
# :is_return => true
|
|
46
|
-
# )
|
|
47
|
-
# @library.buy(:rate => @library.lowest_rate("USPSElectronicMerchandiseReturn",
|
|
48
|
-
# "LibraryMail"))
|
|
49
|
-
# end
|
|
50
|
-
|
|
51
|
-
# it 'buys a first label' do
|
|
52
|
-
# expect(@first).to be_an_instance_of(EasyPost::Shipment)
|
|
53
|
-
# expect(@first.selected_rate).to be_an_instance_of(EasyPost::Rate)
|
|
54
|
-
# expect(@first.selected_rate.service).to eq("First")
|
|
55
|
-
# expect(@first.postage_label.label_url).to end_with(".png")
|
|
56
|
-
# expect(@first.tracking_code).to eq("9499907123456123456781")
|
|
57
|
-
|
|
58
|
-
# label = open(@first.postage_label.label_url)
|
|
59
|
-
# expect(label.size).to be > 30000
|
|
60
|
-
# end
|
|
61
|
-
|
|
62
|
-
# it 'buys a priority label' do
|
|
63
|
-
# expect(@priority.selected_rate.service).to eq("Priority")
|
|
64
|
-
# expect(@priority.tracking_code).to eq("9499907123456123456781")
|
|
65
|
-
|
|
66
|
-
# label = open(@priority.postage_label.label_url)
|
|
67
|
-
# expect(label.size).to be > 30000
|
|
68
|
-
# end
|
|
69
|
-
|
|
70
|
-
# it 'buys a bpm label' do
|
|
71
|
-
# expect(@bpm.selected_rate.service).to eq("BoundPrintedMatter")
|
|
72
|
-
# expect(@bpm.tracking_code).to eq("9499907123456123456781")
|
|
73
|
-
|
|
74
|
-
# label = open(@bpm.postage_label.label_url)
|
|
75
|
-
# expect(label.size).to be > 30000
|
|
76
|
-
# end
|
|
77
|
-
|
|
78
|
-
# it 'buys a media mail label' do
|
|
79
|
-
# expect(@media.selected_rate.service).to eq("MediaMail")
|
|
80
|
-
# expect(@media.tracking_code).to eq("9499907123456123456781")
|
|
81
|
-
|
|
82
|
-
# label = open(@media.postage_label.label_url)
|
|
83
|
-
# expect(label.size).to be > 30000
|
|
84
|
-
# end
|
|
85
|
-
|
|
86
|
-
# it 'buys a library mail label' do
|
|
87
|
-
# expect(@library.selected_rate.service).to eq("LibraryMail")
|
|
88
|
-
# expect(@library.tracking_code).to eq("9499907123456123456781")
|
|
89
|
-
|
|
90
|
-
# label = open(@library.postage_label.label_url)
|
|
91
|
-
# expect(label.size).to be > 30000
|
|
92
|
-
# end
|
|
93
|
-
|
|
94
|
-
# end
|
|
File without changes
|