postmark 1.18.0 → 1.19.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/postmark/api_client.rb +26 -1
- data/lib/postmark/version.rb +1 -1
- data/spec/integration/api_client_hashes_spec.rb +29 -35
- data/spec/integration/api_client_messages_spec.rb +16 -16
- data/spec/integration/api_client_resources_spec.rb +15 -31
- data/spec/spec_helper.rb +1 -7
- data/spec/support/custom_matchers.rb +6 -0
- data/spec/support/shared_examples.rb +16 -16
- data/spec/unit/postmark/account_api_client_spec.rb +1 -50
- data/spec/unit/postmark/api_client_spec.rb +51 -66
- data/spec/unit/postmark/bounce_spec.rb +37 -49
- data/spec/unit/postmark/client_spec.rb +0 -6
- data/spec/unit/postmark/error_spec.rb +44 -44
- data/spec/unit/postmark/handlers/mail_spec.rb +3 -3
- data/spec/unit/postmark/helpers/hash_helper_spec.rb +5 -6
- data/spec/unit/postmark/http_client_spec.rb +47 -49
- data/spec/unit/postmark/inbound_spec.rb +34 -34
- data/spec/unit/postmark/inflector_spec.rb +11 -13
- data/spec/unit/postmark/json_spec.rb +2 -2
- data/spec/unit/postmark/mail_message_converter_spec.rb +79 -82
- data/spec/unit/postmark_spec.rb +32 -32
- metadata +3 -3
data/spec/unit/postmark_spec.rb
CHANGED
@@ -26,37 +26,37 @@ describe Postmark do
|
|
26
26
|
end
|
27
27
|
|
28
28
|
context "attr readers" do
|
29
|
-
it {
|
30
|
-
it {
|
31
|
-
it {
|
32
|
-
it {
|
33
|
-
it {
|
34
|
-
it {
|
35
|
-
it {
|
36
|
-
it {
|
37
|
-
it {
|
38
|
-
it {
|
39
|
-
it {
|
40
|
-
it {
|
41
|
-
it {
|
29
|
+
it { expect(subject).to respond_to(:secure) }
|
30
|
+
it { expect(subject).to respond_to(:api_key) }
|
31
|
+
it { expect(subject).to respond_to(:api_token) }
|
32
|
+
it { expect(subject).to respond_to(:proxy_host) }
|
33
|
+
it { expect(subject).to respond_to(:proxy_port) }
|
34
|
+
it { expect(subject).to respond_to(:proxy_user) }
|
35
|
+
it { expect(subject).to respond_to(:proxy_pass) }
|
36
|
+
it { expect(subject).to respond_to(:host) }
|
37
|
+
it { expect(subject).to respond_to(:port) }
|
38
|
+
it { expect(subject).to respond_to(:path_prefix) }
|
39
|
+
it { expect(subject).to respond_to(:http_open_timeout) }
|
40
|
+
it { expect(subject).to respond_to(:http_read_timeout) }
|
41
|
+
it { expect(subject).to respond_to(:max_retries) }
|
42
42
|
end
|
43
43
|
|
44
44
|
context "attr writers" do
|
45
|
-
it {
|
46
|
-
it {
|
47
|
-
it {
|
48
|
-
it {
|
49
|
-
it {
|
50
|
-
it {
|
51
|
-
it {
|
52
|
-
it {
|
53
|
-
it {
|
54
|
-
it {
|
55
|
-
it {
|
56
|
-
it {
|
57
|
-
it {
|
58
|
-
it {
|
59
|
-
it {
|
45
|
+
it { expect(subject).to respond_to(:secure=) }
|
46
|
+
it { expect(subject).to respond_to(:api_key=) }
|
47
|
+
it { expect(subject).to respond_to(:api_token=) }
|
48
|
+
it { expect(subject).to respond_to(:proxy_host=) }
|
49
|
+
it { expect(subject).to respond_to(:proxy_port=) }
|
50
|
+
it { expect(subject).to respond_to(:proxy_user=) }
|
51
|
+
it { expect(subject).to respond_to(:proxy_pass=) }
|
52
|
+
it { expect(subject).to respond_to(:host=) }
|
53
|
+
it { expect(subject).to respond_to(:port=) }
|
54
|
+
it { expect(subject).to respond_to(:path_prefix=) }
|
55
|
+
it { expect(subject).to respond_to(:http_open_timeout=) }
|
56
|
+
it { expect(subject).to respond_to(:http_read_timeout=) }
|
57
|
+
it { expect(subject).to respond_to(:max_retries=) }
|
58
|
+
it { expect(subject).to respond_to(:response_parser_class=) }
|
59
|
+
it { expect(subject).to respond_to(:api_client=) }
|
60
60
|
end
|
61
61
|
|
62
62
|
describe ".response_parser_class" do
|
@@ -66,12 +66,12 @@ describe Postmark do
|
|
66
66
|
end
|
67
67
|
|
68
68
|
it "returns :ActiveSupport when ActiveSupport::JSON is available" do
|
69
|
-
subject.response_parser_class.
|
69
|
+
expect(subject.response_parser_class).to eq :ActiveSupport
|
70
70
|
end
|
71
71
|
|
72
72
|
it "returns :Json when ActiveSupport::JSON is not available" do
|
73
73
|
hide_const("ActiveSupport::JSON")
|
74
|
-
subject.response_parser_class.
|
74
|
+
expect(subject.response_parser_class).to eq :Json
|
75
75
|
end
|
76
76
|
|
77
77
|
end
|
@@ -91,7 +91,7 @@ describe Postmark do
|
|
91
91
|
|
92
92
|
it 'returns the existing instance' do
|
93
93
|
subject.instance_variable_set(:@api_client, api_client)
|
94
|
-
subject.api_client.
|
94
|
+
expect(subject.api_client).to eq api_client
|
95
95
|
end
|
96
96
|
|
97
97
|
end
|
@@ -111,7 +111,7 @@ describe Postmark do
|
|
111
111
|
:path_prefix => path_prefix,
|
112
112
|
:max_retries => max_retries).
|
113
113
|
and_return(api_client)
|
114
|
-
subject.api_client.
|
114
|
+
expect(subject.api_client).to eq api_client
|
115
115
|
end
|
116
116
|
|
117
117
|
end
|
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.19.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Petyo Ivanov
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2019-
|
13
|
+
date: 2019-11-07 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: json
|
@@ -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.0.
|
149
|
+
rubygems_version: 3.0.6
|
150
150
|
signing_key:
|
151
151
|
specification_version: 4
|
152
152
|
summary: Official Postmark API wrapper.
|