zerobounce-sdk 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +5 -0
- data/Gemfile.lock +3 -1
- data/README.md +100 -7
- data/documentation.md +51 -7
- data/documentation_es.md +50 -6
- data/lib/zerobounce/base_request.rb +2 -2
- data/lib/zerobounce/configuration.rb +2 -0
- data/lib/zerobounce/mock_request.rb +5 -5
- data/lib/zerobounce/request.rb +11 -5
- data/lib/zerobounce/version.rb +1 -1
- data/lib/zerobounce.rb +85 -39
- data/zerobounce.gemspec +1 -0
- metadata +16 -4
- data/output.err +0 -737
- data/output.log +0 -250
data/output.err
DELETED
@@ -1,737 +0,0 @@
|
|
1
|
-
Run options: include {:focus=>true}
|
2
|
-
running mock tests
|
3
|
-
.......F.FF.FF..FF.F..F.FF.FFF.FF..FF..FF.FFF.FFF.FFF
|
4
|
-
|
5
|
-
Failures:
|
6
|
-
|
7
|
-
1) Zerobounce.validate given incorrect API key should raise an API key error
|
8
|
-
Failure/Error:
|
9
|
-
expect{ described_class.validate('valid@example.com') }.to \
|
10
|
-
raise_error(StandardError,
|
11
|
-
/Invalid API key or your account ran out of credits/)
|
12
|
-
|
13
|
-
expected StandardError with message matching /Invalid API key or your account ran out of credits/, got #<WebMock::NetConnectNotAllowedError:"Real HTTP connections are disabled. Unregistered request: GET h...tus: 200, body: \"\", headers: {})\n\n============================================================"> with backtrace:
|
14
|
-
# ./lib/zerobounce/base_request.rb:26:in `_get'
|
15
|
-
# ./lib/zerobounce/mock_request.rb:11:in `get'
|
16
|
-
# ./lib/zerobounce.rb:72:in `validate'
|
17
|
-
# ./spec/mock_spec.rb:56:in `block (5 levels) in <top (required)>'
|
18
|
-
# ./spec/mock_spec.rb:56:in `block (4 levels) in <top (required)>'
|
19
|
-
# ./spec/mock_spec.rb:56:in `block (4 levels) in <top (required)>'
|
20
|
-
|
21
|
-
2) Zerobounce.validate given correct API key given a valid email address should return a valid result
|
22
|
-
Failure/Error: response = RestClient.get(url, {params: params})
|
23
|
-
|
24
|
-
WebMock::NetConnectNotAllowedError:
|
25
|
-
Real HTTP connections are disabled. Unregistered request: GET https://api.zerobounce.net/v2/validate?api_key=99e7ef20ceea4480a173b07b1be75371&email=valid@example.com&ip_address with headers {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Host'=>'api.zerobounce.net', 'User-Agent'=>'rest-client/2.1.0 (linux x86_64) ruby/3.2.1p31'}
|
26
|
-
|
27
|
-
You can stub this request with the following snippet:
|
28
|
-
|
29
|
-
stub_request(:get, "https://api.zerobounce.net/v2/validate?api_key=99e7ef20ceea4480a173b07b1be75371&email=valid@example.com&ip_address").
|
30
|
-
with(
|
31
|
-
headers: {
|
32
|
-
'Accept'=>'*/*',
|
33
|
-
'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
34
|
-
'Host'=>'api.zerobounce.net',
|
35
|
-
'User-Agent'=>'rest-client/2.1.0 (linux x86_64) ruby/3.2.1p31'
|
36
|
-
}).
|
37
|
-
to_return(status: 200, body: "", headers: {})
|
38
|
-
|
39
|
-
============================================================
|
40
|
-
# ./lib/zerobounce/base_request.rb:26:in `_get'
|
41
|
-
# ./lib/zerobounce/mock_request.rb:11:in `get'
|
42
|
-
# ./lib/zerobounce.rb:72:in `validate'
|
43
|
-
# ./spec/mock_spec.rb:73:in `block (5 levels) in <top (required)>'
|
44
|
-
|
45
|
-
3) Zerobounce.validate given correct API key given a valid email address given an IP address should return a valid result
|
46
|
-
Failure/Error: response = RestClient.get(url, {params: params})
|
47
|
-
|
48
|
-
WebMock::NetConnectNotAllowedError:
|
49
|
-
Real HTTP connections are disabled. Unregistered request: GET https://api.zerobounce.net/v2/validate?api_key=99e7ef20ceea4480a173b07b1be75371&email=valid@example.com&ip_address=127.0.0.1 with headers {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Host'=>'api.zerobounce.net', 'User-Agent'=>'rest-client/2.1.0 (linux x86_64) ruby/3.2.1p31'}
|
50
|
-
|
51
|
-
You can stub this request with the following snippet:
|
52
|
-
|
53
|
-
stub_request(:get, "https://api.zerobounce.net/v2/validate?api_key=99e7ef20ceea4480a173b07b1be75371&email=valid@example.com&ip_address=127.0.0.1").
|
54
|
-
with(
|
55
|
-
headers: {
|
56
|
-
'Accept'=>'*/*',
|
57
|
-
'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
58
|
-
'Host'=>'api.zerobounce.net',
|
59
|
-
'User-Agent'=>'rest-client/2.1.0 (linux x86_64) ruby/3.2.1p31'
|
60
|
-
}).
|
61
|
-
to_return(status: 200, body: "", headers: {})
|
62
|
-
|
63
|
-
============================================================
|
64
|
-
# ./lib/zerobounce/base_request.rb:26:in `_get'
|
65
|
-
# ./lib/zerobounce/mock_request.rb:11:in `get'
|
66
|
-
# ./lib/zerobounce.rb:72:in `validate'
|
67
|
-
# ./spec/mock_spec.rb:82:in `block (6 levels) in <top (required)>'
|
68
|
-
|
69
|
-
4) Zerobounce.credits given incorrect API key should return -1 credits
|
70
|
-
Failure/Error: response = RestClient.get(url, {params: params})
|
71
|
-
|
72
|
-
WebMock::NetConnectNotAllowedError:
|
73
|
-
Real HTTP connections are disabled. Unregistered request: GET https://api.zerobounce.net/v2/getcredits?api_key=hjct3kp6nfwlb20ixde7ryvzsgqamou5 with headers {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Host'=>'api.zerobounce.net', 'User-Agent'=>'rest-client/2.1.0 (linux x86_64) ruby/3.2.1p31'}
|
74
|
-
|
75
|
-
You can stub this request with the following snippet:
|
76
|
-
|
77
|
-
stub_request(:get, "https://api.zerobounce.net/v2/getcredits?api_key=hjct3kp6nfwlb20ixde7ryvzsgqamou5").
|
78
|
-
with(
|
79
|
-
headers: {
|
80
|
-
'Accept'=>'*/*',
|
81
|
-
'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
82
|
-
'Host'=>'api.zerobounce.net',
|
83
|
-
'User-Agent'=>'rest-client/2.1.0 (linux x86_64) ruby/3.2.1p31'
|
84
|
-
}).
|
85
|
-
to_return(status: 200, body: "", headers: {})
|
86
|
-
|
87
|
-
============================================================
|
88
|
-
# ./lib/zerobounce/base_request.rb:26:in `_get'
|
89
|
-
# ./lib/zerobounce/mock_request.rb:11:in `get'
|
90
|
-
# ./lib/zerobounce.rb:79:in `credits'
|
91
|
-
# ./spec/mock_spec.rb:106:in `block (4 levels) in <top (required)>'
|
92
|
-
|
93
|
-
5) Zerobounce.credits given correct API key should return the correct number of credits
|
94
|
-
Failure/Error: response = RestClient.get(url, {params: params})
|
95
|
-
|
96
|
-
WebMock::NetConnectNotAllowedError:
|
97
|
-
Real HTTP connections are disabled. Unregistered request: GET https://api.zerobounce.net/v2/getcredits?api_key=99e7ef20ceea4480a173b07b1be75371 with headers {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Host'=>'api.zerobounce.net', 'User-Agent'=>'rest-client/2.1.0 (linux x86_64) ruby/3.2.1p31'}
|
98
|
-
|
99
|
-
You can stub this request with the following snippet:
|
100
|
-
|
101
|
-
stub_request(:get, "https://api.zerobounce.net/v2/getcredits?api_key=99e7ef20ceea4480a173b07b1be75371").
|
102
|
-
with(
|
103
|
-
headers: {
|
104
|
-
'Accept'=>'*/*',
|
105
|
-
'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
106
|
-
'Host'=>'api.zerobounce.net',
|
107
|
-
'User-Agent'=>'rest-client/2.1.0 (linux x86_64) ruby/3.2.1p31'
|
108
|
-
}).
|
109
|
-
to_return(status: 200, body: "", headers: {})
|
110
|
-
|
111
|
-
============================================================
|
112
|
-
# ./lib/zerobounce/base_request.rb:26:in `_get'
|
113
|
-
# ./lib/zerobounce/mock_request.rb:11:in `get'
|
114
|
-
# ./lib/zerobounce.rb:79:in `credits'
|
115
|
-
# ./spec/mock_spec.rb:114:in `block (4 levels) in <top (required)>'
|
116
|
-
|
117
|
-
6) Zerobounce.api_usage given incorrect API key should raise an API key error
|
118
|
-
Failure/Error:
|
119
|
-
expect{ described_class.api_usage(Date.today, Date.today) }.to \
|
120
|
-
raise_error(RuntimeError, /Invalid API key/)
|
121
|
-
|
122
|
-
expected RuntimeError with message matching /Invalid API key/, got #<WebMock::NetConnectNotAllowedError:"Real HTTP connections are disabled. Unregistered request: GET h...tus: 200, body: \"\", headers: {})\n\n============================================================"> with backtrace:
|
123
|
-
# ./lib/zerobounce/base_request.rb:26:in `_get'
|
124
|
-
# ./lib/zerobounce/mock_request.rb:11:in `get'
|
125
|
-
# ./lib/zerobounce.rb:153:in `api_usage'
|
126
|
-
# ./spec/mock_spec.rb:140:in `block (5 levels) in <top (required)>'
|
127
|
-
# ./spec/mock_spec.rb:140:in `block (4 levels) in <top (required)>'
|
128
|
-
# ./spec/mock_spec.rb:140:in `block (4 levels) in <top (required)>'
|
129
|
-
|
130
|
-
7) Zerobounce.api_usage given correct API key should return API usage statistics
|
131
|
-
Failure/Error: response = RestClient.get(url, {params: params})
|
132
|
-
|
133
|
-
WebMock::NetConnectNotAllowedError:
|
134
|
-
Real HTTP connections are disabled. Unregistered request: GET https://api.zerobounce.net/v2/getapiusage?api_key=99e7ef20ceea4480a173b07b1be75371&end_date=2023-04-28&start_date=2023-04-28 with headers {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Host'=>'api.zerobounce.net', 'User-Agent'=>'rest-client/2.1.0 (linux x86_64) ruby/3.2.1p31'}
|
135
|
-
|
136
|
-
You can stub this request with the following snippet:
|
137
|
-
|
138
|
-
stub_request(:get, "https://api.zerobounce.net/v2/getapiusage?api_key=99e7ef20ceea4480a173b07b1be75371&end_date=2023-04-28&start_date=2023-04-28").
|
139
|
-
with(
|
140
|
-
headers: {
|
141
|
-
'Accept'=>'*/*',
|
142
|
-
'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
143
|
-
'Host'=>'api.zerobounce.net',
|
144
|
-
'User-Agent'=>'rest-client/2.1.0 (linux x86_64) ruby/3.2.1p31'
|
145
|
-
}).
|
146
|
-
to_return(status: 200, body: "", headers: {})
|
147
|
-
|
148
|
-
============================================================
|
149
|
-
# ./lib/zerobounce/base_request.rb:26:in `_get'
|
150
|
-
# ./lib/zerobounce/mock_request.rb:11:in `get'
|
151
|
-
# ./lib/zerobounce.rb:153:in `api_usage'
|
152
|
-
# ./spec/mock_spec.rb:149:in `block (4 levels) in <top (required)>'
|
153
|
-
|
154
|
-
8) Zerobounce.validate_batch given incorrect API key should raise an API key error
|
155
|
-
Failure/Error:
|
156
|
-
expect{ described_class.validate_batch(emails) }.to \
|
157
|
-
raise_error(RuntimeError,
|
158
|
-
/Invalid API Key or your account ran out of credits/)
|
159
|
-
|
160
|
-
expected RuntimeError with message matching /Invalid API Key or your account ran out of credits/, got #<WebMock::NetConnectNotAllowedError:"Real HTTP connections are disabled. Unregistered request: POST ...tus: 200, body: \"\", headers: {})\n\n============================================================"> with backtrace:
|
161
|
-
# ./lib/zerobounce/base_request.rb:44:in `_post'
|
162
|
-
# ./lib/zerobounce/mock_request.rb:45:in `bulk_post'
|
163
|
-
# ./lib/zerobounce.rb:204:in `validate_batch'
|
164
|
-
# ./spec/mock_spec.rb:180:in `block (5 levels) in <top (required)>'
|
165
|
-
# ./spec/mock_spec.rb:180:in `block (4 levels) in <top (required)>'
|
166
|
-
# ./spec/mock_spec.rb:180:in `block (4 levels) in <top (required)>'
|
167
|
-
|
168
|
-
9) Zerobounce.validate_batch given correct API key given correct input should return valid results
|
169
|
-
Failure/Error:
|
170
|
-
response = RestClient.post(url, params.to_json, \
|
171
|
-
content_type: :json, accept: :json)
|
172
|
-
|
173
|
-
WebMock::NetConnectNotAllowedError:
|
174
|
-
Real HTTP connections are disabled. Unregistered request: POST https://bulkapi.zerobounce.net/v2/validatebatch with body '{"email_batch":[{"email_address":"disposable@example.com","ip_address":null},{"email_address":"invalid@example.com","ip_address":null},{"email_address":"valid@example.com","ip_address":null},{"email_address":"toxic@example.com","ip_address":null},{"email_address":"donotmail@example.com","ip_address":null},{"email_address":"spamtrap@example.com","ip_address":null}],"api_key":"99e7ef20ceea4480a173b07b1be75371"}' with headers {'Accept'=>'application/json', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Length'=>'412', 'Content-Type'=>'application/json', 'Host'=>'bulkapi.zerobounce.net', 'User-Agent'=>'rest-client/2.1.0 (linux x86_64) ruby/3.2.1p31'}
|
175
|
-
|
176
|
-
You can stub this request with the following snippet:
|
177
|
-
|
178
|
-
stub_request(:post, "https://bulkapi.zerobounce.net/v2/validatebatch").
|
179
|
-
with(
|
180
|
-
body: "{\"email_batch\":[{\"email_address\":\"disposable@example.com\",\"ip_address\":null},{\"email_address\":\"invalid@example.com\",\"ip_address\":null},{\"email_address\":\"valid@example.com\",\"ip_address\":null},{\"email_address\":\"toxic@example.com\",\"ip_address\":null},{\"email_address\":\"donotmail@example.com\",\"ip_address\":null},{\"email_address\":\"spamtrap@example.com\",\"ip_address\":null}],\"api_key\":\"99e7ef20ceea4480a173b07b1be75371\"}",
|
181
|
-
headers: {
|
182
|
-
'Accept'=>'application/json',
|
183
|
-
'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
184
|
-
'Content-Length'=>'412',
|
185
|
-
'Content-Type'=>'application/json',
|
186
|
-
'Host'=>'bulkapi.zerobounce.net',
|
187
|
-
'User-Agent'=>'rest-client/2.1.0 (linux x86_64) ruby/3.2.1p31'
|
188
|
-
}).
|
189
|
-
to_return(status: 200, body: "", headers: {})
|
190
|
-
|
191
|
-
============================================================
|
192
|
-
# ./lib/zerobounce/base_request.rb:44:in `_post'
|
193
|
-
# ./lib/zerobounce/mock_request.rb:45:in `bulk_post'
|
194
|
-
# ./lib/zerobounce.rb:204:in `validate_batch'
|
195
|
-
# ./spec/mock_spec.rb:205:in `block (5 levels) in <top (required)>'
|
196
|
-
|
197
|
-
10) Zerobounce.validate_file_send given incorrect API key should raise an API key error
|
198
|
-
Failure/Error:
|
199
|
-
expect{ described_class.validate_file_send(validate_file_path) }.to \
|
200
|
-
raise_error(RestClient::Unauthorized)
|
201
|
-
|
202
|
-
expected RestClient::Unauthorized, got #<WebMock::NetConnectNotAllowedError:"Real HTTP connections are disabled. Unregistered request: POST ...tus: 200, body: \"\", headers: {})\n\n============================================================"> with backtrace:
|
203
|
-
# ./lib/zerobounce/base_request.rb:41:in `_post'
|
204
|
-
# ./lib/zerobounce/mock_request.rb:45:in `bulk_post'
|
205
|
-
# ./lib/zerobounce.rb:242:in `validate_file_send'
|
206
|
-
# ./spec/mock_spec.rb:233:in `block (5 levels) in <top (required)>'
|
207
|
-
# ./spec/mock_spec.rb:233:in `block (4 levels) in <top (required)>'
|
208
|
-
# ./spec/mock_spec.rb:233:in `block (4 levels) in <top (required)>'
|
209
|
-
|
210
|
-
11) Zerobounce.validate_file_send given correct API key given correct file format should return a correct upload result
|
211
|
-
Failure/Error: response = RestClient.post(url, params)
|
212
|
-
|
213
|
-
WebMock::NetConnectNotAllowedError:
|
214
|
-
Real HTTP connections are disabled. Unregistered request: POST https://bulkapi.zerobounce.net/v2/sendfile with body '------RubyFormBoundaryrBrAjFOpAfmbKkcA
|
215
|
-
Content-Disposition: form-data; name="email_address_column"
|
216
|
-
|
217
|
-
1
|
218
|
-
------RubyFormBoundaryrBrAjFOpAfmbKkcA
|
219
|
-
Content-Disposition: form-data; name="first_name_column"
|
220
|
-
|
221
|
-
2
|
222
|
-
------RubyFormBoundaryrBrAjFOpAfmbKkcA
|
223
|
-
Content-Disposition: form-data; name="last_name_column"
|
224
|
-
|
225
|
-
3
|
226
|
-
------RubyFormBoundaryrBrAjFOpAfmbKkcA
|
227
|
-
Content-Disposition: form-data; name="gender_column"
|
228
|
-
|
229
|
-
4
|
230
|
-
------RubyFormBoundaryrBrAjFOpAfmbKkcA
|
231
|
-
Content-Disposition: form-data; name="has_header_row"
|
232
|
-
|
233
|
-
true
|
234
|
-
------RubyFormBoundaryrBrAjFOpAfmbKkcA
|
235
|
-
Content-Disposition: form-data; name="api_key"
|
236
|
-
|
237
|
-
99e7ef20ceea4480a173b07b1be75371
|
238
|
-
------RubyFormBoundaryrBrAjFOpAfmbKkcA
|
239
|
-
Content-Disposition: form-data; name="file"; filename="validation.csv"
|
240
|
-
Content-Type: text/csv
|
241
|
-
|
242
|
-
email,first,last,gender,ip
|
243
|
-
disposable@example.com,First,Last,male,127.0.0.1
|
244
|
-
invalid@example.com,First,Last,male,127.0.0.1
|
245
|
-
valid@example.com,First,Last,male,127.0.0.1
|
246
|
-
toxic@example.com,First,Last,male,127.0.0.1
|
247
|
-
donotmail@example.com,First,Last,male,127.0.0.1
|
248
|
-
spamtrap@example.com,First,Last,male,127.0.0.1
|
249
|
-
abuse@example.com,First,Last,male,127.0.0.1
|
250
|
-
unknown@example.com,First,Last,male,127.0.0.1
|
251
|
-
catch_all@example.com,First,Last,male,127.0.0.1
|
252
|
-
antispam_system@example.com,First,Last,male,127.0.0.1
|
253
|
-
does_not_accept_mail@example.com,First,Last,male,127.0.0.1
|
254
|
-
exception_occurred@example.com,First,Last,male,127.0.0.1
|
255
|
-
failed_smtp_connection@example.com,First,Last,male,127.0.0.1
|
256
|
-
failed_syntax_check@example.com,First,Last,male,127.0.0.1
|
257
|
-
forcible_disconnect@example.com,First,Last,male,127.0.0.1
|
258
|
-
global_suppression@example.com,First,Last,male,127.0.0.1
|
259
|
-
greylisted@example.com,First,Last,male,127.0.0.1
|
260
|
-
leading_period_removed@example.com,First,Last,male,127.0.0.1
|
261
|
-
mail_server_did_not_respond@example.com,First,Last,male,127.0.0.1
|
262
|
-
mail_server_temporary_error@example.com,First,Last,male,127.0.0.1
|
263
|
-
mailbox_quota_exceeded@example.com,First,Last,male,127.0.0.1
|
264
|
-
mailbox_not_found@example.com,First,Last,male,127.0.0.1
|
265
|
-
no_dns_entries@example.com,First,Last,male,127.0.0.1
|
266
|
-
possible_trap@example.com,First,Last,male,127.0.0.1
|
267
|
-
possible_typo@example.com,First,Last,male,127.0.0.1
|
268
|
-
role_based@example.com,First,Last,male,127.0.0.1
|
269
|
-
timeout_exceeded@example.com,First,Last,male,127.0.0.1
|
270
|
-
unroutable_ip_address@example.com,First,Last,male,127.0.0.1
|
271
|
-
free_email@example.com,First,Last,male,127.0.0.1
|
272
|
-
role_based_catch_all@example.com,First,Last,male,127.0.0.1
|
273
|
-
------RubyFormBoundaryrBrAjFOpAfmbKkcA--
|
274
|
-
' with headers {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Length'=>'2483', 'Content-Type'=>'multipart/form-data; boundary=----RubyFormBoundaryrBrAjFOpAfmbKkcA', 'Host'=>'bulkapi.zerobounce.net', 'User-Agent'=>'rest-client/2.1.0 (linux x86_64) ruby/3.2.1p31'}
|
275
|
-
|
276
|
-
You can stub this request with the following snippet:
|
277
|
-
|
278
|
-
stub_request(:post, "https://bulkapi.zerobounce.net/v2/sendfile").
|
279
|
-
with(
|
280
|
-
body: "------RubyFormBoundaryrBrAjFOpAfmbKkcA\r\nContent-Disposition: form-data; name=\"email_address_column\"\r\n\r\n1\r\n------RubyFormBoundaryrBrAjFOpAfmbKkcA\r\nContent-Disposition: form-data; name=\"first_name_column\"\r\n\r\n2\r\n------RubyFormBoundaryrBrAjFOpAfmbKkcA\r\nContent-Disposition: form-data; name=\"last_name_column\"\r\n\r\n3\r\n------RubyFormBoundaryrBrAjFOpAfmbKkcA\r\nContent-Disposition: form-data; name=\"gender_column\"\r\n\r\n4\r\n------RubyFormBoundaryrBrAjFOpAfmbKkcA\r\nContent-Disposition: form-data; name=\"has_header_row\"\r\n\r\ntrue\r\n------RubyFormBoundaryrBrAjFOpAfmbKkcA\r\nContent-Disposition: form-data; name=\"api_key\"\r\n\r\n99e7ef20ceea4480a173b07b1be75371\r\n------RubyFormBoundaryrBrAjFOpAfmbKkcA\r\nContent-Disposition: form-data; name=\"file\"; filename=\"validation.csv\"\r\nContent-Type: text/csv\r\n\r\nemail,first,last,gender,ip\r\ndisposable@example.com,First,Last,male,127.0.0.1\r\ninvalid@example.com,First,Last,male,127.0.0.1\r\nvalid@example.com,First,Last,male,127.0.0.1\r\ntoxic@example.com,First,Last,male,127.0.0.1\r\ndonotmail@example.com,First,Last,male,127.0.0.1\r\nspamtrap@example.com,First,Last,male,127.0.0.1\r\nabuse@example.com,First,Last,male,127.0.0.1\r\nunknown@example.com,First,Last,male,127.0.0.1\r\ncatch_all@example.com,First,Last,male,127.0.0.1\r\nantispam_system@example.com,First,Last,male,127.0.0.1\r\ndoes_not_accept_mail@example.com,First,Last,male,127.0.0.1\r\nexception_occurred@example.com,First,Last,male,127.0.0.1\r\nfailed_smtp_connection@example.com,First,Last,male,127.0.0.1\r\nfailed_syntax_check@example.com,First,Last,male,127.0.0.1\r\nforcible_disconnect@example.com,First,Last,male,127.0.0.1\r\nglobal_suppression@example.com,First,Last,male,127.0.0.1\r\ngreylisted@example.com,First,Last,male,127.0.0.1\r\nleading_period_removed@example.com,First,Last,male,127.0.0.1\r\nmail_server_did_not_respond@example.com,First,Last,male,127.0.0.1\r\nmail_server_temporary_error@example.com,First,Last,male,127.0.0.1\r\nmailbox_quota_exceeded@example.com,First,Last,male,127.0.0.1\r\nmailbox_not_found@example.com,First,Last,male,127.0.0.1\r\nno_dns_entries@example.com,First,Last,male,127.0.0.1\r\npossible_trap@example.com,First,Last,male,127.0.0.1\r\npossible_typo@example.com,First,Last,male,127.0.0.1\r\nrole_based@example.com,First,Last,male,127.0.0.1\r\ntimeout_exceeded@example.com,First,Last,male,127.0.0.1\r\nunroutable_ip_address@example.com,First,Last,male,127.0.0.1\r\nfree_email@example.com,First,Last,male,127.0.0.1\r\nrole_based_catch_all@example.com,First,Last,male,127.0.0.1\r\n------RubyFormBoundaryrBrAjFOpAfmbKkcA--\r\n",
|
281
|
-
headers: {
|
282
|
-
'Accept'=>'*/*',
|
283
|
-
'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
284
|
-
'Content-Length'=>'2483',
|
285
|
-
'Content-Type'=>'multipart/form-data; boundary=----RubyFormBoundaryrBrAjFOpAfmbKkcA',
|
286
|
-
'Host'=>'bulkapi.zerobounce.net',
|
287
|
-
'User-Agent'=>'rest-client/2.1.0 (linux x86_64) ruby/3.2.1p31'
|
288
|
-
}).
|
289
|
-
to_return(status: 200, body: "", headers: {})
|
290
|
-
|
291
|
-
============================================================
|
292
|
-
# ./lib/zerobounce/base_request.rb:41:in `_post'
|
293
|
-
# ./lib/zerobounce/mock_request.rb:45:in `bulk_post'
|
294
|
-
# ./lib/zerobounce.rb:242:in `validate_file_send'
|
295
|
-
# ./spec/mock_spec.rb:246:in `block (5 levels) in <top (required)>'
|
296
|
-
|
297
|
-
12) Zerobounce.validate_file_check given incorrect API key should raise an API key error
|
298
|
-
Failure/Error:
|
299
|
-
expect{ described_class.validate_file_check(validate_file_id) }.to \
|
300
|
-
raise_error(RestClient::Unauthorized)
|
301
|
-
|
302
|
-
expected RestClient::Unauthorized, got #<WebMock::NetConnectNotAllowedError:"Real HTTP connections are disabled. Unregistered request: GET h...tus: 200, body: \"\", headers: {})\n\n============================================================"> with backtrace:
|
303
|
-
# ./lib/zerobounce/base_request.rb:26:in `_get'
|
304
|
-
# ./lib/zerobounce/mock_request.rb:28:in `bulk_get'
|
305
|
-
# ./lib/zerobounce.rb:263:in `validate_file_check'
|
306
|
-
# ./spec/mock_spec.rb:270:in `block (5 levels) in <top (required)>'
|
307
|
-
# ./spec/mock_spec.rb:270:in `block (4 levels) in <top (required)>'
|
308
|
-
# ./spec/mock_spec.rb:270:in `block (4 levels) in <top (required)>'
|
309
|
-
|
310
|
-
13) Zerobounce.validate_file_check given correct API key given incorrect file id should return error message
|
311
|
-
Failure/Error: response = RestClient.get(url, {params: params})
|
312
|
-
|
313
|
-
WebMock::NetConnectNotAllowedError:
|
314
|
-
Real HTTP connections are disabled. Unregistered request: GET https://bulkapi.zerobounce.net/v2/filestatus?api_key=99e7ef20ceea4480a173b07b1be75371&file_id=invalid-file-id with headers {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Host'=>'bulkapi.zerobounce.net', 'User-Agent'=>'rest-client/2.1.0 (linux x86_64) ruby/3.2.1p31'}
|
315
|
-
|
316
|
-
You can stub this request with the following snippet:
|
317
|
-
|
318
|
-
stub_request(:get, "https://bulkapi.zerobounce.net/v2/filestatus?api_key=99e7ef20ceea4480a173b07b1be75371&file_id=invalid-file-id").
|
319
|
-
with(
|
320
|
-
headers: {
|
321
|
-
'Accept'=>'*/*',
|
322
|
-
'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
323
|
-
'Host'=>'bulkapi.zerobounce.net',
|
324
|
-
'User-Agent'=>'rest-client/2.1.0 (linux x86_64) ruby/3.2.1p31'
|
325
|
-
}).
|
326
|
-
to_return(status: 200, body: "", headers: {})
|
327
|
-
|
328
|
-
============================================================
|
329
|
-
# ./lib/zerobounce/base_request.rb:26:in `_get'
|
330
|
-
# ./lib/zerobounce/mock_request.rb:28:in `bulk_get'
|
331
|
-
# ./lib/zerobounce.rb:263:in `validate_file_check'
|
332
|
-
# ./spec/mock_spec.rb:280:in `block (5 levels) in <top (required)>'
|
333
|
-
|
334
|
-
14) Zerobounce.validate_file_check given correct API key given correct file id should return file processing progress
|
335
|
-
Failure/Error: response = RestClient.get(url, {params: params})
|
336
|
-
|
337
|
-
WebMock::NetConnectNotAllowedError:
|
338
|
-
Real HTTP connections are disabled. Unregistered request: GET https://bulkapi.zerobounce.net/v2/filestatus?api_key=99e7ef20ceea4480a173b07b1be75371&file_id with headers {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Host'=>'bulkapi.zerobounce.net', 'User-Agent'=>'rest-client/2.1.0 (linux x86_64) ruby/3.2.1p31'}
|
339
|
-
|
340
|
-
You can stub this request with the following snippet:
|
341
|
-
|
342
|
-
stub_request(:get, "https://bulkapi.zerobounce.net/v2/filestatus?api_key=99e7ef20ceea4480a173b07b1be75371&file_id").
|
343
|
-
with(
|
344
|
-
headers: {
|
345
|
-
'Accept'=>'*/*',
|
346
|
-
'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
347
|
-
'Host'=>'bulkapi.zerobounce.net',
|
348
|
-
'User-Agent'=>'rest-client/2.1.0 (linux x86_64) ruby/3.2.1p31'
|
349
|
-
}).
|
350
|
-
to_return(status: 200, body: "", headers: {})
|
351
|
-
|
352
|
-
============================================================
|
353
|
-
# ./lib/zerobounce/base_request.rb:26:in `_get'
|
354
|
-
# ./lib/zerobounce/mock_request.rb:28:in `bulk_get'
|
355
|
-
# ./lib/zerobounce.rb:263:in `validate_file_check'
|
356
|
-
# ./spec/mock_spec.rb:287:in `block (5 levels) in <top (required)>'
|
357
|
-
|
358
|
-
15) Zerobounce.validate_file_get given incorrect API key should raise an API key error
|
359
|
-
Failure/Error:
|
360
|
-
expect{ described_class.validate_file_get(validate_file_id) }.to \
|
361
|
-
raise_error(RestClient::Unauthorized)
|
362
|
-
|
363
|
-
expected RestClient::Unauthorized, got #<WebMock::NetConnectNotAllowedError:"Real HTTP connections are disabled. Unregistered request: GET h...tus: 200, body: \"\", headers: {})\n\n============================================================"> with backtrace:
|
364
|
-
# ./lib/zerobounce/base_request.rb:26:in `_get'
|
365
|
-
# ./lib/zerobounce/mock_request.rb:28:in `bulk_get'
|
366
|
-
# ./lib/zerobounce.rb:274:in `validate_file_get'
|
367
|
-
# ./spec/mock_spec.rb:310:in `block (5 levels) in <top (required)>'
|
368
|
-
# ./spec/mock_spec.rb:310:in `block (4 levels) in <top (required)>'
|
369
|
-
# ./spec/mock_spec.rb:310:in `block (4 levels) in <top (required)>'
|
370
|
-
|
371
|
-
16) Zerobounce.validate_file_get given correct API key given incorrect file id should return error message
|
372
|
-
Failure/Error: response = RestClient.get(url, {params: params})
|
373
|
-
|
374
|
-
WebMock::NetConnectNotAllowedError:
|
375
|
-
Real HTTP connections are disabled. Unregistered request: GET https://bulkapi.zerobounce.net/v2/getfile?api_key=99e7ef20ceea4480a173b07b1be75371&file_id=invalid-file-id with headers {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Host'=>'bulkapi.zerobounce.net', 'User-Agent'=>'rest-client/2.1.0 (linux x86_64) ruby/3.2.1p31'}
|
376
|
-
|
377
|
-
You can stub this request with the following snippet:
|
378
|
-
|
379
|
-
stub_request(:get, "https://bulkapi.zerobounce.net/v2/getfile?api_key=99e7ef20ceea4480a173b07b1be75371&file_id=invalid-file-id").
|
380
|
-
with(
|
381
|
-
headers: {
|
382
|
-
'Accept'=>'*/*',
|
383
|
-
'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
384
|
-
'Host'=>'bulkapi.zerobounce.net',
|
385
|
-
'User-Agent'=>'rest-client/2.1.0 (linux x86_64) ruby/3.2.1p31'
|
386
|
-
}).
|
387
|
-
to_return(status: 200, body: "", headers: {})
|
388
|
-
|
389
|
-
============================================================
|
390
|
-
# ./lib/zerobounce/base_request.rb:26:in `_get'
|
391
|
-
# ./lib/zerobounce/mock_request.rb:28:in `bulk_get'
|
392
|
-
# ./lib/zerobounce.rb:274:in `validate_file_get'
|
393
|
-
# ./spec/mock_spec.rb:320:in `block (5 levels) in <top (required)>'
|
394
|
-
|
395
|
-
17) Zerobounce.validate_file_delete given incorrect API key should raise an API key error
|
396
|
-
Failure/Error:
|
397
|
-
expect{ described_class.validate_file_delete(validate_file_id) }.to \
|
398
|
-
raise_error(RestClient::Unauthorized)
|
399
|
-
|
400
|
-
expected RestClient::Unauthorized, got #<WebMock::NetConnectNotAllowedError:"Real HTTP connections are disabled. Unregistered request: GET h...tus: 200, body: \"\", headers: {})\n\n============================================================"> with backtrace:
|
401
|
-
# ./lib/zerobounce/base_request.rb:26:in `_get'
|
402
|
-
# ./lib/zerobounce/mock_request.rb:28:in `bulk_get'
|
403
|
-
# ./lib/zerobounce.rb:291:in `validate_file_delete'
|
404
|
-
# ./spec/mock_spec.rb:349:in `block (5 levels) in <top (required)>'
|
405
|
-
# ./spec/mock_spec.rb:349:in `block (4 levels) in <top (required)>'
|
406
|
-
# ./spec/mock_spec.rb:349:in `block (4 levels) in <top (required)>'
|
407
|
-
|
408
|
-
18) Zerobounce.validate_file_delete given correct API key given incorrect file id should return error message
|
409
|
-
Failure/Error: response = RestClient.get(url, {params: params})
|
410
|
-
|
411
|
-
WebMock::NetConnectNotAllowedError:
|
412
|
-
Real HTTP connections are disabled. Unregistered request: GET https://bulkapi.zerobounce.net/v2/deletefile?api_key=99e7ef20ceea4480a173b07b1be75371&file_id=invalid-file-id with headers {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Host'=>'bulkapi.zerobounce.net', 'User-Agent'=>'rest-client/2.1.0 (linux x86_64) ruby/3.2.1p31'}
|
413
|
-
|
414
|
-
You can stub this request with the following snippet:
|
415
|
-
|
416
|
-
stub_request(:get, "https://bulkapi.zerobounce.net/v2/deletefile?api_key=99e7ef20ceea4480a173b07b1be75371&file_id=invalid-file-id").
|
417
|
-
with(
|
418
|
-
headers: {
|
419
|
-
'Accept'=>'*/*',
|
420
|
-
'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
421
|
-
'Host'=>'bulkapi.zerobounce.net',
|
422
|
-
'User-Agent'=>'rest-client/2.1.0 (linux x86_64) ruby/3.2.1p31'
|
423
|
-
}).
|
424
|
-
to_return(status: 200, body: "", headers: {})
|
425
|
-
|
426
|
-
============================================================
|
427
|
-
# ./lib/zerobounce/base_request.rb:26:in `_get'
|
428
|
-
# ./lib/zerobounce/mock_request.rb:28:in `bulk_get'
|
429
|
-
# ./lib/zerobounce.rb:291:in `validate_file_delete'
|
430
|
-
# ./spec/mock_spec.rb:359:in `block (5 levels) in <top (required)>'
|
431
|
-
|
432
|
-
19) Zerobounce.scoring_file_send given incorrect API key should raise an API key error
|
433
|
-
Failure/Error:
|
434
|
-
expect{ described_class.scoring_file_send(scoring_file_path) }.to \
|
435
|
-
raise_error(RestClient::Unauthorized)
|
436
|
-
|
437
|
-
expected RestClient::Unauthorized, got #<WebMock::NetConnectNotAllowedError:"Real HTTP connections are disabled. Unregistered request: POST ...tus: 200, body: \"\", headers: {})\n\n============================================================"> with backtrace:
|
438
|
-
# ./lib/zerobounce/base_request.rb:41:in `_post'
|
439
|
-
# ./lib/zerobounce/mock_request.rb:45:in `bulk_post'
|
440
|
-
# ./lib/zerobounce.rb:319:in `scoring_file_send'
|
441
|
-
# ./spec/mock_spec.rb:391:in `block (5 levels) in <top (required)>'
|
442
|
-
# ./spec/mock_spec.rb:391:in `block (4 levels) in <top (required)>'
|
443
|
-
# ./spec/mock_spec.rb:391:in `block (4 levels) in <top (required)>'
|
444
|
-
|
445
|
-
20) Zerobounce.scoring_file_send given correct API key given correct file format should return a correct upload result
|
446
|
-
Failure/Error: response = RestClient.post(url, params)
|
447
|
-
|
448
|
-
WebMock::NetConnectNotAllowedError:
|
449
|
-
Real HTTP connections are disabled. Unregistered request: POST https://bulkapi.zerobounce.net/v2/scoring/sendfile with body '------RubyFormBoundaryDU2Kroes1yRNSpSa
|
450
|
-
Content-Disposition: form-data; name="email_address_column"
|
451
|
-
|
452
|
-
1
|
453
|
-
------RubyFormBoundaryDU2Kroes1yRNSpSa
|
454
|
-
Content-Disposition: form-data; name="has_header_row"
|
455
|
-
|
456
|
-
true
|
457
|
-
------RubyFormBoundaryDU2Kroes1yRNSpSa
|
458
|
-
Content-Disposition: form-data; name="api_key"
|
459
|
-
|
460
|
-
99e7ef20ceea4480a173b07b1be75371
|
461
|
-
------RubyFormBoundaryDU2Kroes1yRNSpSa
|
462
|
-
Content-Disposition: form-data; name="file"; filename="scoring.csv"
|
463
|
-
Content-Type: text/csv
|
464
|
-
|
465
|
-
email
|
466
|
-
disposable@example.com
|
467
|
-
invalid@example.com
|
468
|
-
valid@example.com
|
469
|
-
toxic@example.com
|
470
|
-
donotmail@example.com
|
471
|
-
spamtrap@example.com
|
472
|
-
abuse@example.com
|
473
|
-
unknown@example.com
|
474
|
-
catch_all@example.com
|
475
|
-
antispam_system@example.com
|
476
|
-
does_not_accept_mail@example.com
|
477
|
-
exception_occurred@example.com
|
478
|
-
failed_smtp_connection@example.com
|
479
|
-
failed_syntax_check@example.com
|
480
|
-
forcible_disconnect@example.com
|
481
|
-
global_suppression@example.com
|
482
|
-
greylisted@example.com
|
483
|
-
leading_period_removed@example.com
|
484
|
-
mail_server_did_not_respond@example.com
|
485
|
-
mail_server_temporary_error@example.com
|
486
|
-
mailbox_quota_exceeded@example.com
|
487
|
-
mailbox_not_found@example.com
|
488
|
-
no_dns_entries@example.com
|
489
|
-
possible_trap@example.com
|
490
|
-
possible_typo@example.com
|
491
|
-
role_based@example.com
|
492
|
-
timeout_exceeded@example.com
|
493
|
-
unroutable_ip_address@example.com
|
494
|
-
free_email@example.com
|
495
|
-
role_based_catch_all@example.com
|
496
|
-
------RubyFormBoundaryDU2Kroes1yRNSpSa--
|
497
|
-
' with headers {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Length'=>'1375', 'Content-Type'=>'multipart/form-data; boundary=----RubyFormBoundaryDU2Kroes1yRNSpSa', 'Host'=>'bulkapi.zerobounce.net', 'User-Agent'=>'rest-client/2.1.0 (linux x86_64) ruby/3.2.1p31'}
|
498
|
-
|
499
|
-
You can stub this request with the following snippet:
|
500
|
-
|
501
|
-
stub_request(:post, "https://bulkapi.zerobounce.net/v2/scoring/sendfile").
|
502
|
-
with(
|
503
|
-
body: "------RubyFormBoundaryDU2Kroes1yRNSpSa\r\nContent-Disposition: form-data; name=\"email_address_column\"\r\n\r\n1\r\n------RubyFormBoundaryDU2Kroes1yRNSpSa\r\nContent-Disposition: form-data; name=\"has_header_row\"\r\n\r\ntrue\r\n------RubyFormBoundaryDU2Kroes1yRNSpSa\r\nContent-Disposition: form-data; name=\"api_key\"\r\n\r\n99e7ef20ceea4480a173b07b1be75371\r\n------RubyFormBoundaryDU2Kroes1yRNSpSa\r\nContent-Disposition: form-data; name=\"file\"; filename=\"scoring.csv\"\r\nContent-Type: text/csv\r\n\r\nemail\r\ndisposable@example.com\r\ninvalid@example.com\r\nvalid@example.com\r\ntoxic@example.com\r\ndonotmail@example.com\r\nspamtrap@example.com\r\nabuse@example.com\r\nunknown@example.com\r\ncatch_all@example.com\r\nantispam_system@example.com\r\ndoes_not_accept_mail@example.com\r\nexception_occurred@example.com\r\nfailed_smtp_connection@example.com\r\nfailed_syntax_check@example.com\r\nforcible_disconnect@example.com\r\nglobal_suppression@example.com\r\ngreylisted@example.com\r\nleading_period_removed@example.com\r\nmail_server_did_not_respond@example.com\r\nmail_server_temporary_error@example.com\r\nmailbox_quota_exceeded@example.com\r\nmailbox_not_found@example.com\r\nno_dns_entries@example.com\r\npossible_trap@example.com\r\npossible_typo@example.com\r\nrole_based@example.com\r\ntimeout_exceeded@example.com\r\nunroutable_ip_address@example.com\r\nfree_email@example.com\r\nrole_based_catch_all@example.com\r\n------RubyFormBoundaryDU2Kroes1yRNSpSa--\r\n",
|
504
|
-
headers: {
|
505
|
-
'Accept'=>'*/*',
|
506
|
-
'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
507
|
-
'Content-Length'=>'1375',
|
508
|
-
'Content-Type'=>'multipart/form-data; boundary=----RubyFormBoundaryDU2Kroes1yRNSpSa',
|
509
|
-
'Host'=>'bulkapi.zerobounce.net',
|
510
|
-
'User-Agent'=>'rest-client/2.1.0 (linux x86_64) ruby/3.2.1p31'
|
511
|
-
}).
|
512
|
-
to_return(status: 200, body: "", headers: {})
|
513
|
-
|
514
|
-
============================================================
|
515
|
-
# ./lib/zerobounce/base_request.rb:41:in `_post'
|
516
|
-
# ./lib/zerobounce/mock_request.rb:45:in `bulk_post'
|
517
|
-
# ./lib/zerobounce.rb:319:in `scoring_file_send'
|
518
|
-
# ./spec/mock_spec.rb:404:in `block (5 levels) in <top (required)>'
|
519
|
-
|
520
|
-
21) Zerobounce.scoring_file_check given incorrect API key should raise an API key error
|
521
|
-
Failure/Error:
|
522
|
-
expect{ described_class.scoring_file_check(scoring_file_id) }.to \
|
523
|
-
raise_error(RestClient::Unauthorized)
|
524
|
-
|
525
|
-
expected RestClient::Unauthorized, got #<WebMock::NetConnectNotAllowedError:"Real HTTP connections are disabled. Unregistered request: GET h...tus: 200, body: \"\", headers: {})\n\n============================================================"> with backtrace:
|
526
|
-
# ./lib/zerobounce/base_request.rb:26:in `_get'
|
527
|
-
# ./lib/zerobounce/mock_request.rb:28:in `bulk_get'
|
528
|
-
# ./lib/zerobounce.rb:349:in `scoring_file_check'
|
529
|
-
# ./spec/mock_spec.rb:428:in `block (5 levels) in <top (required)>'
|
530
|
-
# ./spec/mock_spec.rb:428:in `block (4 levels) in <top (required)>'
|
531
|
-
# ./spec/mock_spec.rb:428:in `block (4 levels) in <top (required)>'
|
532
|
-
|
533
|
-
22) Zerobounce.scoring_file_check given correct API key given incorrect file id should return an error message
|
534
|
-
Failure/Error: response = RestClient.get(url, {params: params})
|
535
|
-
|
536
|
-
WebMock::NetConnectNotAllowedError:
|
537
|
-
Real HTTP connections are disabled. Unregistered request: GET https://bulkapi.zerobounce.net/v2/scoring/filestatus?api_key=99e7ef20ceea4480a173b07b1be75371&file_id=invalid-file-id with headers {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Host'=>'bulkapi.zerobounce.net', 'User-Agent'=>'rest-client/2.1.0 (linux x86_64) ruby/3.2.1p31'}
|
538
|
-
|
539
|
-
You can stub this request with the following snippet:
|
540
|
-
|
541
|
-
stub_request(:get, "https://bulkapi.zerobounce.net/v2/scoring/filestatus?api_key=99e7ef20ceea4480a173b07b1be75371&file_id=invalid-file-id").
|
542
|
-
with(
|
543
|
-
headers: {
|
544
|
-
'Accept'=>'*/*',
|
545
|
-
'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
546
|
-
'Host'=>'bulkapi.zerobounce.net',
|
547
|
-
'User-Agent'=>'rest-client/2.1.0 (linux x86_64) ruby/3.2.1p31'
|
548
|
-
}).
|
549
|
-
to_return(status: 200, body: "", headers: {})
|
550
|
-
|
551
|
-
============================================================
|
552
|
-
# ./lib/zerobounce/base_request.rb:26:in `_get'
|
553
|
-
# ./lib/zerobounce/mock_request.rb:28:in `bulk_get'
|
554
|
-
# ./lib/zerobounce.rb:349:in `scoring_file_check'
|
555
|
-
# ./spec/mock_spec.rb:438:in `block (5 levels) in <top (required)>'
|
556
|
-
|
557
|
-
23) Zerobounce.scoring_file_check given correct API key given correct file id should return file processing progress
|
558
|
-
Failure/Error: response = RestClient.get(url, {params: params})
|
559
|
-
|
560
|
-
WebMock::NetConnectNotAllowedError:
|
561
|
-
Real HTTP connections are disabled. Unregistered request: GET https://bulkapi.zerobounce.net/v2/scoring/filestatus?api_key=99e7ef20ceea4480a173b07b1be75371&file_id with headers {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Host'=>'bulkapi.zerobounce.net', 'User-Agent'=>'rest-client/2.1.0 (linux x86_64) ruby/3.2.1p31'}
|
562
|
-
|
563
|
-
You can stub this request with the following snippet:
|
564
|
-
|
565
|
-
stub_request(:get, "https://bulkapi.zerobounce.net/v2/scoring/filestatus?api_key=99e7ef20ceea4480a173b07b1be75371&file_id").
|
566
|
-
with(
|
567
|
-
headers: {
|
568
|
-
'Accept'=>'*/*',
|
569
|
-
'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
570
|
-
'Host'=>'bulkapi.zerobounce.net',
|
571
|
-
'User-Agent'=>'rest-client/2.1.0 (linux x86_64) ruby/3.2.1p31'
|
572
|
-
}).
|
573
|
-
to_return(status: 200, body: "", headers: {})
|
574
|
-
|
575
|
-
============================================================
|
576
|
-
# ./lib/zerobounce/base_request.rb:26:in `_get'
|
577
|
-
# ./lib/zerobounce/mock_request.rb:28:in `bulk_get'
|
578
|
-
# ./lib/zerobounce.rb:349:in `scoring_file_check'
|
579
|
-
# ./spec/mock_spec.rb:445:in `block (5 levels) in <top (required)>'
|
580
|
-
|
581
|
-
24) Zerobounce.scoring_file_get given incorrect API key should raise an API key error
|
582
|
-
Failure/Error:
|
583
|
-
expect{ described_class.scoring_file_get(scoring_file_id) }.to \
|
584
|
-
raise_error(RestClient::Unauthorized)
|
585
|
-
|
586
|
-
expected RestClient::Unauthorized, got #<WebMock::NetConnectNotAllowedError:"Real HTTP connections are disabled. Unregistered request: GET h...tus: 200, body: \"\", headers: {})\n\n============================================================"> with backtrace:
|
587
|
-
# ./lib/zerobounce/base_request.rb:26:in `_get'
|
588
|
-
# ./lib/zerobounce/mock_request.rb:28:in `bulk_get'
|
589
|
-
# ./lib/zerobounce.rb:330:in `scoring_file_get'
|
590
|
-
# ./spec/mock_spec.rb:468:in `block (5 levels) in <top (required)>'
|
591
|
-
# ./spec/mock_spec.rb:468:in `block (4 levels) in <top (required)>'
|
592
|
-
# ./spec/mock_spec.rb:468:in `block (4 levels) in <top (required)>'
|
593
|
-
|
594
|
-
25) Zerobounce.scoring_file_get given correct API key given incorrect file id should return an error
|
595
|
-
Failure/Error: response = RestClient.get(url, {params: params})
|
596
|
-
|
597
|
-
WebMock::NetConnectNotAllowedError:
|
598
|
-
Real HTTP connections are disabled. Unregistered request: GET https://bulkapi.zerobounce.net/v2/scoring/getfile?api_key=99e7ef20ceea4480a173b07b1be75371&file_id=invalid-file-id with headers {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Host'=>'bulkapi.zerobounce.net', 'User-Agent'=>'rest-client/2.1.0 (linux x86_64) ruby/3.2.1p31'}
|
599
|
-
|
600
|
-
You can stub this request with the following snippet:
|
601
|
-
|
602
|
-
stub_request(:get, "https://bulkapi.zerobounce.net/v2/scoring/getfile?api_key=99e7ef20ceea4480a173b07b1be75371&file_id=invalid-file-id").
|
603
|
-
with(
|
604
|
-
headers: {
|
605
|
-
'Accept'=>'*/*',
|
606
|
-
'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
607
|
-
'Host'=>'bulkapi.zerobounce.net',
|
608
|
-
'User-Agent'=>'rest-client/2.1.0 (linux x86_64) ruby/3.2.1p31'
|
609
|
-
}).
|
610
|
-
to_return(status: 200, body: "", headers: {})
|
611
|
-
|
612
|
-
============================================================
|
613
|
-
# ./lib/zerobounce/base_request.rb:26:in `_get'
|
614
|
-
# ./lib/zerobounce/mock_request.rb:28:in `bulk_get'
|
615
|
-
# ./lib/zerobounce.rb:330:in `scoring_file_get'
|
616
|
-
# ./spec/mock_spec.rb:478:in `block (5 levels) in <top (required)>'
|
617
|
-
|
618
|
-
26) Zerobounce.scoring_file_get given correct API key given correct file id should download file contents
|
619
|
-
Failure/Error: response = RestClient.get(url, {params: params})
|
620
|
-
|
621
|
-
WebMock::NetConnectNotAllowedError:
|
622
|
-
Real HTTP connections are disabled. Unregistered request: GET https://bulkapi.zerobounce.net/v2/scoring/getfile?api_key=99e7ef20ceea4480a173b07b1be75371&file_id with headers {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Host'=>'bulkapi.zerobounce.net', 'User-Agent'=>'rest-client/2.1.0 (linux x86_64) ruby/3.2.1p31'}
|
623
|
-
|
624
|
-
You can stub this request with the following snippet:
|
625
|
-
|
626
|
-
stub_request(:get, "https://bulkapi.zerobounce.net/v2/scoring/getfile?api_key=99e7ef20ceea4480a173b07b1be75371&file_id").
|
627
|
-
with(
|
628
|
-
headers: {
|
629
|
-
'Accept'=>'*/*',
|
630
|
-
'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
631
|
-
'Host'=>'bulkapi.zerobounce.net',
|
632
|
-
'User-Agent'=>'rest-client/2.1.0 (linux x86_64) ruby/3.2.1p31'
|
633
|
-
}).
|
634
|
-
to_return(status: 200, body: "", headers: {})
|
635
|
-
|
636
|
-
============================================================
|
637
|
-
# ./lib/zerobounce/base_request.rb:26:in `_get'
|
638
|
-
# ./lib/zerobounce/mock_request.rb:28:in `bulk_get'
|
639
|
-
# ./lib/zerobounce.rb:330:in `scoring_file_get'
|
640
|
-
# ./spec/mock_spec.rb:488:in `block (5 levels) in <top (required)>'
|
641
|
-
|
642
|
-
27) Zerobounce.scoring_file_delete given incorrect API key should raise an API key error
|
643
|
-
Failure/Error:
|
644
|
-
expect{ described_class.scoring_file_delete(scoring_file_id) }.to \
|
645
|
-
raise_error(RestClient::Unauthorized)
|
646
|
-
|
647
|
-
expected RestClient::Unauthorized, got #<WebMock::NetConnectNotAllowedError:"Real HTTP connections are disabled. Unregistered request: GET h...tus: 200, body: \"\", headers: {})\n\n============================================================"> with backtrace:
|
648
|
-
# ./lib/zerobounce/base_request.rb:26:in `_get'
|
649
|
-
# ./lib/zerobounce/mock_request.rb:28:in `bulk_get'
|
650
|
-
# ./lib/zerobounce.rb:366:in `scoring_file_delete'
|
651
|
-
# ./spec/mock_spec.rb:507:in `block (5 levels) in <top (required)>'
|
652
|
-
# ./spec/mock_spec.rb:507:in `block (4 levels) in <top (required)>'
|
653
|
-
# ./spec/mock_spec.rb:507:in `block (4 levels) in <top (required)>'
|
654
|
-
|
655
|
-
28) Zerobounce.scoring_file_delete given correct API key given incorrect file id should return an error
|
656
|
-
Failure/Error: response = RestClient.get(url, {params: params})
|
657
|
-
|
658
|
-
WebMock::NetConnectNotAllowedError:
|
659
|
-
Real HTTP connections are disabled. Unregistered request: GET https://bulkapi.zerobounce.net/v2/scoring/deletefile?api_key=99e7ef20ceea4480a173b07b1be75371&file_id=invalid-file-id with headers {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Host'=>'bulkapi.zerobounce.net', 'User-Agent'=>'rest-client/2.1.0 (linux x86_64) ruby/3.2.1p31'}
|
660
|
-
|
661
|
-
You can stub this request with the following snippet:
|
662
|
-
|
663
|
-
stub_request(:get, "https://bulkapi.zerobounce.net/v2/scoring/deletefile?api_key=99e7ef20ceea4480a173b07b1be75371&file_id=invalid-file-id").
|
664
|
-
with(
|
665
|
-
headers: {
|
666
|
-
'Accept'=>'*/*',
|
667
|
-
'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
668
|
-
'Host'=>'bulkapi.zerobounce.net',
|
669
|
-
'User-Agent'=>'rest-client/2.1.0 (linux x86_64) ruby/3.2.1p31'
|
670
|
-
}).
|
671
|
-
to_return(status: 200, body: "", headers: {})
|
672
|
-
|
673
|
-
============================================================
|
674
|
-
# ./lib/zerobounce/base_request.rb:26:in `_get'
|
675
|
-
# ./lib/zerobounce/mock_request.rb:28:in `bulk_get'
|
676
|
-
# ./lib/zerobounce.rb:366:in `scoring_file_delete'
|
677
|
-
# ./spec/mock_spec.rb:517:in `block (5 levels) in <top (required)>'
|
678
|
-
|
679
|
-
29) Zerobounce.scoring_file_delete given correct API key given correct file id should return the correct file deleted response
|
680
|
-
Failure/Error: response = RestClient.get(url, {params: params})
|
681
|
-
|
682
|
-
WebMock::NetConnectNotAllowedError:
|
683
|
-
Real HTTP connections are disabled. Unregistered request: GET https://bulkapi.zerobounce.net/v2/scoring/deletefile?api_key=99e7ef20ceea4480a173b07b1be75371&file_id with headers {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Host'=>'bulkapi.zerobounce.net', 'User-Agent'=>'rest-client/2.1.0 (linux x86_64) ruby/3.2.1p31'}
|
684
|
-
|
685
|
-
You can stub this request with the following snippet:
|
686
|
-
|
687
|
-
stub_request(:get, "https://bulkapi.zerobounce.net/v2/scoring/deletefile?api_key=99e7ef20ceea4480a173b07b1be75371&file_id").
|
688
|
-
with(
|
689
|
-
headers: {
|
690
|
-
'Accept'=>'*/*',
|
691
|
-
'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
692
|
-
'Host'=>'bulkapi.zerobounce.net',
|
693
|
-
'User-Agent'=>'rest-client/2.1.0 (linux x86_64) ruby/3.2.1p31'
|
694
|
-
}).
|
695
|
-
to_return(status: 200, body: "", headers: {})
|
696
|
-
|
697
|
-
============================================================
|
698
|
-
# ./lib/zerobounce/base_request.rb:26:in `_get'
|
699
|
-
# ./lib/zerobounce/mock_request.rb:28:in `bulk_get'
|
700
|
-
# ./lib/zerobounce.rb:366:in `scoring_file_delete'
|
701
|
-
# ./spec/mock_spec.rb:524:in `block (5 levels) in <top (required)>'
|
702
|
-
|
703
|
-
Finished in 0.12734 seconds (files took 0.49398 seconds to load)
|
704
|
-
53 examples, 29 failures
|
705
|
-
|
706
|
-
Failed examples:
|
707
|
-
|
708
|
-
rspec ./spec/mock_spec.rb:54 # Zerobounce.validate given incorrect API key should raise an API key error
|
709
|
-
rspec ./spec/mock_spec.rb:72 # Zerobounce.validate given correct API key given a valid email address should return a valid result
|
710
|
-
rspec ./spec/mock_spec.rb:81 # Zerobounce.validate given correct API key given a valid email address given an IP address should return a valid result
|
711
|
-
rspec ./spec/mock_spec.rb:105 # Zerobounce.credits given incorrect API key should return -1 credits
|
712
|
-
rspec ./spec/mock_spec.rb:113 # Zerobounce.credits given correct API key should return the correct number of credits
|
713
|
-
rspec ./spec/mock_spec.rb:139 # Zerobounce.api_usage given incorrect API key should raise an API key error
|
714
|
-
rspec ./spec/mock_spec.rb:148 # Zerobounce.api_usage given correct API key should return API usage statistics
|
715
|
-
rspec ./spec/mock_spec.rb:179 # Zerobounce.validate_batch given incorrect API key should raise an API key error
|
716
|
-
rspec ./spec/mock_spec.rb:204 # Zerobounce.validate_batch given correct API key given correct input should return valid results
|
717
|
-
rspec ./spec/mock_spec.rb:232 # Zerobounce.validate_file_send given incorrect API key should raise an API key error
|
718
|
-
rspec ./spec/mock_spec.rb:245 # Zerobounce.validate_file_send given correct API key given correct file format should return a correct upload result
|
719
|
-
rspec ./spec/mock_spec.rb:269 # Zerobounce.validate_file_check given incorrect API key should raise an API key error
|
720
|
-
rspec ./spec/mock_spec.rb:279 # Zerobounce.validate_file_check given correct API key given incorrect file id should return error message
|
721
|
-
rspec ./spec/mock_spec.rb:286 # Zerobounce.validate_file_check given correct API key given correct file id should return file processing progress
|
722
|
-
rspec ./spec/mock_spec.rb:309 # Zerobounce.validate_file_get given incorrect API key should raise an API key error
|
723
|
-
rspec ./spec/mock_spec.rb:319 # Zerobounce.validate_file_get given correct API key given incorrect file id should return error message
|
724
|
-
rspec ./spec/mock_spec.rb:348 # Zerobounce.validate_file_delete given incorrect API key should raise an API key error
|
725
|
-
rspec ./spec/mock_spec.rb:358 # Zerobounce.validate_file_delete given correct API key given incorrect file id should return error message
|
726
|
-
rspec ./spec/mock_spec.rb:390 # Zerobounce.scoring_file_send given incorrect API key should raise an API key error
|
727
|
-
rspec ./spec/mock_spec.rb:403 # Zerobounce.scoring_file_send given correct API key given correct file format should return a correct upload result
|
728
|
-
rspec ./spec/mock_spec.rb:427 # Zerobounce.scoring_file_check given incorrect API key should raise an API key error
|
729
|
-
rspec ./spec/mock_spec.rb:437 # Zerobounce.scoring_file_check given correct API key given incorrect file id should return an error message
|
730
|
-
rspec ./spec/mock_spec.rb:444 # Zerobounce.scoring_file_check given correct API key given correct file id should return file processing progress
|
731
|
-
rspec ./spec/mock_spec.rb:467 # Zerobounce.scoring_file_get given incorrect API key should raise an API key error
|
732
|
-
rspec ./spec/mock_spec.rb:477 # Zerobounce.scoring_file_get given correct API key given incorrect file id should return an error
|
733
|
-
rspec ./spec/mock_spec.rb:487 # Zerobounce.scoring_file_get given correct API key given correct file id should download file contents
|
734
|
-
rspec ./spec/mock_spec.rb:506 # Zerobounce.scoring_file_delete given incorrect API key should raise an API key error
|
735
|
-
rspec ./spec/mock_spec.rb:516 # Zerobounce.scoring_file_delete given correct API key given incorrect file id should return an error
|
736
|
-
rspec ./spec/mock_spec.rb:523 # Zerobounce.scoring_file_delete given correct API key given correct file id should return the correct file deleted response
|
737
|
-
|