easypost 2.6.0 → 2.6.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.
- checksums.yaml +4 -4
- data/CHANGELOG +4 -0
- data/VERSION +1 -1
- data/lib/easypost/scan_form.rb +4 -0
- data/spec/scan_form_spec.rb +46 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61161e60bf6a4791174a84913e9fc529070d5fb9
|
4
|
+
data.tar.gz: d4f2ead98f93b0c7bade87d44dd1ee51975da916
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3aa0be9844f2fc9d50e24de2303e75508168308337ac80d9955b7d1fb1ce1d081587b910680ffcf04222c7b399212c737f5c50720e42d4f1477d95212a7df3d9
|
7
|
+
data.tar.gz: dbf4390fd05a6b9ba7f5c28934804fead30a595570fffff4ac933df344d2a20899f7153a085f7d0d216533eae9a70e911f5b7d12f3b007e9355f6e708e80a6f3
|
data/CHANGELOG
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.6.
|
1
|
+
2.6.1
|
data/lib/easypost/scan_form.rb
CHANGED
@@ -0,0 +1,46 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe EasyPost::ScanForm do
|
4
|
+
let(:shipment) do
|
5
|
+
shipment = EasyPost::Shipment.create(
|
6
|
+
to_address: ADDRESS[:canada],
|
7
|
+
from_address: ADDRESS[:california],
|
8
|
+
parcel: PARCEL[:dimensions],
|
9
|
+
customs_info: CUSTOMS_INFO[:shirt]
|
10
|
+
)
|
11
|
+
|
12
|
+
shipment.buy(
|
13
|
+
rate: shipment.lowest_rate("usps")
|
14
|
+
)
|
15
|
+
end
|
16
|
+
|
17
|
+
describe '#create' do
|
18
|
+
it 'purchases postage for an international shipment' do
|
19
|
+
scan_form = EasyPost::ScanForm.create(shipments: [shipment])
|
20
|
+
|
21
|
+
expect(scan_form.id).not_to be_nil
|
22
|
+
expect(scan_form.tracking_codes.first).to eq(shipment.tracking_code)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
describe '#retrieve' do
|
27
|
+
let(:scan_form) { EasyPost::ScanForm.create(shipments: [shipment]) }
|
28
|
+
|
29
|
+
it 'retrieves the same scan_form' do
|
30
|
+
scan_form2 = EasyPost::ScanForm.retrieve(scan_form.id)
|
31
|
+
|
32
|
+
expect(scan_form2.id).to eq(scan_form.id)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
describe '#all' do
|
37
|
+
let!(:scan_form) { EasyPost::ScanForm.create(shipments: [shipment]) }
|
38
|
+
|
39
|
+
it 'indexes the scan_forms' do
|
40
|
+
params = {page_size: 2}
|
41
|
+
scan_forms = EasyPost::ScanForm.all(params)
|
42
|
+
|
43
|
+
expect(scan_forms["scan_forms"].first.id).to eq(scan_form.id)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easypost
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.6.
|
4
|
+
version: 2.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sawyer Bateman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -136,6 +136,7 @@ files:
|
|
136
136
|
- spec/order_spec.rb
|
137
137
|
- spec/pickup_spec.rb
|
138
138
|
- spec/report_spec.rb
|
139
|
+
- spec/scan_form_spec.rb
|
139
140
|
- spec/shipment_spec.rb
|
140
141
|
- spec/spec_helper.rb
|
141
142
|
- spec/support/constant.rb
|
@@ -175,6 +176,7 @@ test_files:
|
|
175
176
|
- spec/order_spec.rb
|
176
177
|
- spec/pickup_spec.rb
|
177
178
|
- spec/report_spec.rb
|
179
|
+
- spec/scan_form_spec.rb
|
178
180
|
- spec/shipment_spec.rb
|
179
181
|
- spec/spec_helper.rb
|
180
182
|
- spec/support/constant.rb
|