postmark 1.19.2 → 1.20.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 +4 -4
- data/.travis.yml +3 -0
- data/CHANGELOG.rdoc +4 -0
- data/VERSION +1 -1
- data/lib/postmark/api_client.rb +0 -5
- data/lib/postmark/version.rb +1 -1
- data/spec/integration/api_client_resources_spec.rb +1 -18
- data/spec/unit/postmark/api_client_spec.rb +1 -44
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 587a749e850a9a9fc2e70087fd13fa79d926844246f8030942d116ac6fbbcaec
|
4
|
+
data.tar.gz: 20fc00b9b8b59d45afe4722abd859cc4248f63ce487d190167aec0b957bd3c76
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4049417165d062f7d923a0b84e1c4b31791930e24c6c58d1171bbc0cb189cdbbe53736ee720b994c2a467d94afba7225512c39975f6fcd7d56d63b7c7cc567e
|
7
|
+
data.tar.gz: 7fce7304875e3a7877a73e697450fb82bfbdb2404a44337dfe6591e099476e7d57ead59ce9e30182f01825b4cfc7ca61ff49a1871cf9368b13bf74fe39753e05
|
data/.travis.yml
CHANGED
data/CHANGELOG.rdoc
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.20.0
|
data/lib/postmark/api_client.rb
CHANGED
@@ -197,11 +197,6 @@ module Postmark
|
|
197
197
|
format_response http_client.get("triggers/#{type}/#{id}")
|
198
198
|
end
|
199
199
|
|
200
|
-
def update_trigger(type, id, options)
|
201
|
-
data = serialize(HashHelper.to_postmark(options))
|
202
|
-
format_response http_client.put("triggers/#{type}/#{id}", data)
|
203
|
-
end
|
204
|
-
|
205
200
|
def delete_trigger(type, id)
|
206
201
|
type = Postmark::Inflector.to_postmark(type).downcase
|
207
202
|
format_response http_client.delete("triggers/#{type}/#{id}")
|
data/lib/postmark/version.rb
CHANGED
@@ -14,23 +14,6 @@ describe 'Accessing server resources using the API' do
|
|
14
14
|
}
|
15
15
|
}
|
16
16
|
|
17
|
-
context 'Triggers API' do
|
18
|
-
let(:unique_token) {rand(36 ** 32).to_s(36)}
|
19
|
-
|
20
|
-
it 'can be used to manage tag triggers via the API' do
|
21
|
-
skip("Endpoint removed")
|
22
|
-
trigger = api_client.create_trigger(:tags, :match_name => "gemtest_#{unique_token}", :track_opens => true)
|
23
|
-
api_client.update_trigger(:tags, trigger[:id], :match_name => "pre_#{trigger[:match_name]}")
|
24
|
-
updated = api_client.get_trigger(:tags, trigger[:id])
|
25
|
-
|
26
|
-
expect(updated[:id]).to eq(trigger[:id])
|
27
|
-
expect(updated[:match_name]).not_to eq(trigger[:id])
|
28
|
-
expect(api_client.triggers(:tags).map {|t| t[:id]}).to include(trigger[:id])
|
29
|
-
|
30
|
-
api_client.delete_trigger(:tags, trigger[:id])
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
17
|
context 'Messages API' do
|
35
18
|
def with_retries(max_retries = 20, wait_seconds = 3)
|
36
19
|
yield
|
@@ -70,4 +53,4 @@ describe 'Accessing server resources using the API' do
|
|
70
53
|
}.not_to raise_error
|
71
54
|
end
|
72
55
|
end
|
73
|
-
end
|
56
|
+
end
|
@@ -538,22 +538,6 @@ describe Postmark::ApiClient do
|
|
538
538
|
describe '#create_trigger' do
|
539
539
|
let(:http_client) {subject.http_client}
|
540
540
|
|
541
|
-
context 'tags' do
|
542
|
-
let(:options) {{:foo => 'bar'}}
|
543
|
-
let(:response) {{'Foo' => 'Bar'}}
|
544
|
-
|
545
|
-
it 'performs a POST request to /triggers/tags with given options' do
|
546
|
-
allow(http_client).to receive(:post).with('triggers/tags',
|
547
|
-
{'Foo' => 'bar'}.to_json)
|
548
|
-
subject.create_trigger(:tags, options)
|
549
|
-
end
|
550
|
-
|
551
|
-
it 'symbolizes response keys' do
|
552
|
-
allow(http_client).to receive(:post).and_return(response)
|
553
|
-
expect(subject.create_trigger(:tags, options)).to eq(:foo => 'Bar')
|
554
|
-
end
|
555
|
-
end
|
556
|
-
|
557
541
|
context 'inbound rules' do
|
558
542
|
let(:options) {{:rule => 'example.com'}}
|
559
543
|
let(:response) {{'Rule' => 'example.com'}}
|
@@ -586,23 +570,6 @@ describe Postmark::ApiClient do
|
|
586
570
|
end
|
587
571
|
end
|
588
572
|
|
589
|
-
describe '#update_trigger' do
|
590
|
-
let(:http_client) {subject.http_client}
|
591
|
-
let(:options) {{:foo => 'bar'}}
|
592
|
-
let(:id) {42}
|
593
|
-
|
594
|
-
it 'performs a PUT request to /triggers/tags/:id' do
|
595
|
-
allow(http_client).to receive(:put).with("triggers/tags/#{id}",
|
596
|
-
{'Foo' => 'bar'}.to_json)
|
597
|
-
subject.update_trigger(:tags, id, options)
|
598
|
-
end
|
599
|
-
|
600
|
-
it 'symbolizes response keys' do
|
601
|
-
allow(http_client).to receive(:put).and_return('Foo' => 'Bar')
|
602
|
-
expect(subject.update_trigger(:tags, id, options)).to eq(:foo => 'Bar')
|
603
|
-
end
|
604
|
-
end
|
605
|
-
|
606
573
|
describe '#delete_trigger' do
|
607
574
|
let(:http_client) {subject.http_client}
|
608
575
|
|
@@ -619,7 +586,7 @@ describe Postmark::ApiClient do
|
|
619
586
|
expect(subject.delete_trigger(:tags, id)).to eq(:foo => 'Bar')
|
620
587
|
end
|
621
588
|
end
|
622
|
-
|
589
|
+
|
623
590
|
context 'inbound rules' do
|
624
591
|
let(:id) {42}
|
625
592
|
|
@@ -639,16 +606,6 @@ describe Postmark::ApiClient do
|
|
639
606
|
let(:http_client) {subject.http_client}
|
640
607
|
let(:options) {{:offset => 5}}
|
641
608
|
|
642
|
-
context 'tags' do
|
643
|
-
let(:response) {{'Tags' => [], 'TotalCount' => 0}}
|
644
|
-
|
645
|
-
it 'performs a GET request to /triggers/tags' do
|
646
|
-
allow(http_client).to receive(:get).with('triggers/tags', options) {response}
|
647
|
-
expect(subject.get_triggers(:tags, options)).to be_an(Array)
|
648
|
-
expect(subject.get_triggers(:tags, options).count).to be_zero
|
649
|
-
end
|
650
|
-
end
|
651
|
-
|
652
609
|
context 'inbound rules' do
|
653
610
|
let(:response) {{'InboundRules' => [], 'TotalCount' => 0}}
|
654
611
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: postmark
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.20.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Petyo Ivanov
|
@@ -146,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
146
146
|
- !ruby/object:Gem::Version
|
147
147
|
version: 1.3.7
|
148
148
|
requirements: []
|
149
|
-
rubygems_version: 3.
|
149
|
+
rubygems_version: 3.0.6
|
150
150
|
signing_key:
|
151
151
|
specification_version: 4
|
152
152
|
summary: Official Postmark API wrapper.
|