easypost 2.0.11 → 2.0.12
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +6 -0
- data/Gemfile.lock +3 -3
- data/VERSION +1 -1
- data/lib/easypost.rb +3 -0
- data/lib/easypost/container.rb +4 -0
- data/lib/easypost/item.rb +10 -0
- data/lib/easypost/order.rb +19 -0
- data/lib/easypost/shipment.rb +3 -9
- data/lib/easypost/util.rb +6 -0
- data/spec/address_spec.rb +16 -38
- data/spec/batch_spec.rb +24 -70
- data/spec/container_spec.rb +87 -0
- data/spec/fedex/domestic_spec.rb +170 -0
- data/spec/fedex/international_spec.rb +64 -0
- data/spec/item_spec.rb +102 -0
- data/spec/order_spec.rb +120 -0
- data/spec/shipment_spec.rb +22 -83
- data/spec/spec_helper.rb +83 -70
- data/spec/ups/domestic_spec.rb +64 -0
- data/spec/ups/international_spec.rb +64 -0
- data/spec/usps/domestic_spec.rb +66 -0
- data/spec/usps/electronic_merchandise_returns.rb +94 -0
- data/spec/usps/merchant_returns.rb +0 -0
- metadata +15 -4
- data/spec/refund_spec.rb +0 -65
- data/spec/scan_form_spec.rb +0 -63
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easypost
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.12
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2014-07-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|
@@ -85,11 +85,14 @@ files:
|
|
85
85
|
- lib/easypost.rb
|
86
86
|
- lib/easypost/address.rb
|
87
87
|
- lib/easypost/batch.rb
|
88
|
+
- lib/easypost/container.rb
|
88
89
|
- lib/easypost/customs_info.rb
|
89
90
|
- lib/easypost/customs_item.rb
|
90
91
|
- lib/easypost/error.rb
|
91
92
|
- lib/easypost/event.rb
|
93
|
+
- lib/easypost/item.rb
|
92
94
|
- lib/easypost/object.rb
|
95
|
+
- lib/easypost/order.rb
|
93
96
|
- lib/easypost/parcel.rb
|
94
97
|
- lib/easypost/postage_label.rb
|
95
98
|
- lib/easypost/rate.rb
|
@@ -102,10 +105,18 @@ files:
|
|
102
105
|
- lib/easypost/version.rb
|
103
106
|
- spec/address_spec.rb
|
104
107
|
- spec/batch_spec.rb
|
105
|
-
- spec/
|
106
|
-
- spec/
|
108
|
+
- spec/container_spec.rb
|
109
|
+
- spec/fedex/domestic_spec.rb
|
110
|
+
- spec/fedex/international_spec.rb
|
111
|
+
- spec/item_spec.rb
|
112
|
+
- spec/order_spec.rb
|
107
113
|
- spec/shipment_spec.rb
|
108
114
|
- spec/spec_helper.rb
|
115
|
+
- spec/ups/domestic_spec.rb
|
116
|
+
- spec/ups/international_spec.rb
|
117
|
+
- spec/usps/domestic_spec.rb
|
118
|
+
- spec/usps/electronic_merchandise_returns.rb
|
119
|
+
- spec/usps/merchant_returns.rb
|
109
120
|
homepage: https://www.easypost.com/docs
|
110
121
|
licenses: []
|
111
122
|
post_install_message:
|
data/spec/refund_spec.rb
DELETED
@@ -1,65 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe EasyPost::Refund do
|
4
|
-
describe '#create' do
|
5
|
-
context 'tracking code string' do
|
6
|
-
before :all do
|
7
|
-
@tracking_codes = '12345, 39474, 26547, 18373'
|
8
|
-
end
|
9
|
-
|
10
|
-
it 'creates Refunds' do
|
11
|
-
refunds = EasyPost::Refund.create(
|
12
|
-
:carrier => 'USPS',
|
13
|
-
:tracking_codes => @tracking_codes
|
14
|
-
)
|
15
|
-
expect(refunds).to be_an_instance_of(Array)
|
16
|
-
expect(refunds.size).to eq(4)
|
17
|
-
end
|
18
|
-
end
|
19
|
-
context 'tracking code array' do
|
20
|
-
before :all do
|
21
|
-
@tracking_codes = ['12345', '39474, 26547', 18373, '22479']
|
22
|
-
end
|
23
|
-
|
24
|
-
it 'creates Refunds' do
|
25
|
-
refunds = EasyPost::Refund.create(
|
26
|
-
:carrier => 'USPS',
|
27
|
-
:tracking_codes => @tracking_codes
|
28
|
-
)
|
29
|
-
expect(refunds).to be_an_instance_of(Array)
|
30
|
-
expect(refunds.size).to eq(5)
|
31
|
-
end
|
32
|
-
|
33
|
-
it 'fails to create without tracking codes' do
|
34
|
-
expect{EasyPost::Refund.create()}.to raise_error(EasyPost::Error)
|
35
|
-
|
36
|
-
begin
|
37
|
-
EasyPost::Refund.create()
|
38
|
-
rescue EasyPost::Error => e
|
39
|
-
expect(e.message).to eq('Invalid or missing param: tracking_codes')
|
40
|
-
expect(e.param).to eq('tracking_codes')
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
describe '#retrieve' do
|
47
|
-
before :all do
|
48
|
-
@tracking_codes = '12345, 39474, 26547, 18373'
|
49
|
-
end
|
50
|
-
it 'retrieves refund' do
|
51
|
-
refunds = EasyPost::Refund.create(
|
52
|
-
:carrier => 'USPS',
|
53
|
-
:tracking_codes => @tracking_codes
|
54
|
-
)
|
55
|
-
refunds.each do |refund|
|
56
|
-
if refund.id
|
57
|
-
retrieved_refund = EasyPost::Refund.retrieve(refund.id)
|
58
|
-
expect(retrieved_refund).to be_an_instance_of(EasyPost::Refund)
|
59
|
-
break
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
end
|
data/spec/scan_form_spec.rb
DELETED
@@ -1,63 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe EasyPost::ScanForm do
|
4
|
-
describe '#create' do
|
5
|
-
context 'tracking code string' do
|
6
|
-
before :all do
|
7
|
-
@tracking_codes = '12345, 39474, 26547, 18373'
|
8
|
-
end
|
9
|
-
|
10
|
-
it 'creates a ScanForm' do
|
11
|
-
scan_form = EasyPost::ScanForm.create(
|
12
|
-
:from_address => address_california,
|
13
|
-
:tracking_codes => @tracking_codes
|
14
|
-
)
|
15
|
-
expect(scan_form).to be_an_instance_of(EasyPost::ScanForm)
|
16
|
-
expect(scan_form.tracking_codes).to be_an_instance_of(Array)
|
17
|
-
expect(scan_form.tracking_codes.size).to eq(4)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
context 'tracking code array' do
|
21
|
-
before :all do
|
22
|
-
@tracking_codes = ['12345', '39474, 26547', 18373, '22479']
|
23
|
-
end
|
24
|
-
|
25
|
-
it 'creates a ScanForm' do
|
26
|
-
scan_form = EasyPost::ScanForm.create(
|
27
|
-
:from_address => address_missouri,
|
28
|
-
:tracking_codes => @tracking_codes
|
29
|
-
)
|
30
|
-
expect(scan_form).to be_an_instance_of(EasyPost::ScanForm)
|
31
|
-
expect(scan_form.tracking_codes).to be_an_instance_of(Array)
|
32
|
-
expect(scan_form.tracking_codes.size).to eq(5)
|
33
|
-
end
|
34
|
-
|
35
|
-
it 'fails to create without tracking codes' do
|
36
|
-
expect{EasyPost::ScanForm.create()}.to raise_error(EasyPost::Error)
|
37
|
-
|
38
|
-
begin
|
39
|
-
EasyPost::ScanForm.create()
|
40
|
-
rescue EasyPost::Error => e
|
41
|
-
#puts e.inspect
|
42
|
-
expect(e.message).to eq('Invalid or missing param: tracking_codes')
|
43
|
-
expect(e.param).to eq('tracking_codes')
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
describe '#retrieve' do
|
50
|
-
before :all do
|
51
|
-
@tracking_codes = '12345, 39474, 26547, 18373'
|
52
|
-
end
|
53
|
-
it 'retrieves scan_form' do
|
54
|
-
scan_form = EasyPost::ScanForm.create(
|
55
|
-
:from_address => address_california,
|
56
|
-
:tracking_codes => @tracking_codes
|
57
|
-
)
|
58
|
-
retrieved_scan_form = EasyPost::ScanForm.retrieve(scan_form.id)
|
59
|
-
|
60
|
-
expect(retrieved_scan_form).to be_an_instance_of(EasyPost::ScanForm)
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|