easypost 2.7.1 → 3.1.3
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/.travis.yml +9 -0
- data/CHANGELOG +39 -0
- data/README.md +1 -1
- data/VERSION +1 -1
- data/easypost.gemspec +24 -19
- data/lib/easypost.rb +108 -119
- data/lib/easypost/address.rb +5 -5
- data/lib/easypost/batch.rb +7 -7
- data/lib/easypost/carrier_account.rb +1 -1
- data/lib/easypost/customs_info.rb +5 -0
- data/lib/easypost/customs_item.rb +5 -0
- data/lib/easypost/error.rb +16 -23
- data/lib/easypost/item.rb +1 -1
- data/lib/easypost/object.rb +7 -7
- data/lib/easypost/order.rb +6 -2
- data/lib/easypost/pickup.rb +7 -2
- data/lib/easypost/printer.rb +2 -2
- data/lib/easypost/report.rb +2 -2
- data/lib/easypost/resource.rb +7 -7
- data/lib/easypost/scan_form.rb +1 -1
- data/lib/easypost/shipment.rb +5 -17
- data/lib/easypost/tracker.rb +2 -2
- data/lib/easypost/user.rb +3 -5
- data/lib/easypost/util.rb +16 -50
- data/lib/easypost/webhook.rb +6 -3
- metadata +42 -72
- data/circle.yml +0 -3
- data/lib/easypost/container.rb +0 -4
- data/spec/address_spec.rb +0 -81
- data/spec/batch_spec.rb +0 -48
- data/spec/carrier_account_spec.rb +0 -121
- data/spec/container_spec.rb +0 -76
- data/spec/insurance_spec.rb +0 -69
- data/spec/item_spec.rb +0 -105
- data/spec/order_spec.rb +0 -58
- data/spec/pickup_spec.rb +0 -83
- data/spec/report_spec.rb +0 -59
- data/spec/scan_form_spec.rb +0 -46
- data/spec/shipment_spec.rb +0 -169
- data/spec/spec_helper.rb +0 -10
- data/spec/support/constant.rb +0 -97
- data/spec/tracker_spec.rb +0 -94
- data/spec/user_spec.rb +0 -88
- data/spec/webhook_spec.rb +0 -75
data/spec/webhook_spec.rb
DELETED
@@ -1,75 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe EasyPost::Webhook do
|
4
|
-
let(:url) { "http://example.com" }
|
5
|
-
let(:webhook) { EasyPost::Webhook.create({url: url}) }
|
6
|
-
|
7
|
-
context 'with automated cleanup' do
|
8
|
-
after do
|
9
|
-
webhook.delete()
|
10
|
-
end
|
11
|
-
|
12
|
-
describe '#create' do
|
13
|
-
it 'creates' do
|
14
|
-
expect(webhook.id).not_to be_nil
|
15
|
-
expect(webhook.url).to eq(url)
|
16
|
-
expect(webhook.mode).to eq("test")
|
17
|
-
expect(webhook.disabled_at).to be_nil
|
18
|
-
expect(webhook.class).to eq(EasyPost::Webhook)
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
describe '#retrieve' do
|
23
|
-
it 'retrieves' do
|
24
|
-
hook = EasyPost::Webhook.retrieve(webhook.id)
|
25
|
-
|
26
|
-
expect(hook.id).to eq(webhook.id)
|
27
|
-
expect(hook.url).to eq(url)
|
28
|
-
expect(hook.mode).to eq("test")
|
29
|
-
expect(hook.disabled_at).to be_nil
|
30
|
-
expect(hook.class).to eq(EasyPost::Webhook)
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
describe '#index' do
|
35
|
-
it 'indexes with the recently created webhook as the last one' do
|
36
|
-
webhook
|
37
|
-
webhooks = EasyPost::Webhook.all()
|
38
|
-
|
39
|
-
hook = webhooks["webhooks"].last
|
40
|
-
|
41
|
-
expect(hook.id).to eq(webhook.id)
|
42
|
-
expect(hook.url).to eq(url)
|
43
|
-
expect(hook.mode).to eq("test")
|
44
|
-
expect(hook.disabled_at).to be_nil
|
45
|
-
expect(hook.class).to eq(EasyPost::Webhook)
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
describe '#retrieve' do
|
50
|
-
it 'retrieves' do
|
51
|
-
hook = webhook.update()
|
52
|
-
|
53
|
-
expect(hook.id).to eq(webhook.id)
|
54
|
-
expect(hook.url).to eq(url)
|
55
|
-
expect(hook.mode).to eq("test")
|
56
|
-
expect(hook.disabled_at).to be_nil
|
57
|
-
expect(hook.class).to eq(EasyPost::Webhook)
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
describe '#delete' do
|
63
|
-
it 'deletes the tracker' do
|
64
|
-
webhook.delete()
|
65
|
-
|
66
|
-
begin
|
67
|
-
EasyPost::Webhook.retrieve(webhook.id)
|
68
|
-
rescue EasyPost::Error => e
|
69
|
-
expect(e.http_status).to eq(404)
|
70
|
-
expect(e.code).to eq("NOT_FOUND")
|
71
|
-
expect(e.message).to eq("The requested resource could not be found.")
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|