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.
@@ -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