effective_test_bot 1.5.10 → 1.5.12
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9203029533864033577b0e25871a22cc59ddfe75fc7008dbaccc55f4bf3b6780
|
4
|
+
data.tar.gz: 8749084f4ffc48685415c59101ca39f8bc43a59434a0de94ae440e16a7f3a6fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb9e3634e05de135efb68e4090c1866c68fedede2bd368334b0984a9b37132d1ac5bd689f7edec09f62b2cebaa326b95105bf4ed9fda31c06ca1b51c87c81f66
|
7
|
+
data.tar.gz: 5278bb90f77e4c54ff1c5ac6fafde73d7e7fd047e773efb35a0e3a14718f00acd4515f8e41bbcea26dcea7997f86626499156f9e48a2903c79bbd1505ee605d3
|
@@ -253,14 +253,17 @@ module EffectiveTestBotAssertions
|
|
253
253
|
# assert_email :new_user_sign_up
|
254
254
|
# assert_email :new_user_sign_up, to: 'newuser@example.com'
|
255
255
|
# assert_email from: 'admin@example.com'
|
256
|
-
def assert_email(action = nil, perform: true, to: nil, from: nil, subject: nil, body: nil, message: nil, count: nil, plain_layout: nil, html_layout: nil, &block)
|
256
|
+
def assert_email(action = nil, perform: true, clear: nil, to: nil, from: nil, subject: nil, body: nil, message: nil, count: nil, plain_layout: nil, html_layout: nil, &block)
|
257
257
|
retval = nil
|
258
|
+
clear = (count || 0) < 2 if clear.nil?
|
258
259
|
|
259
260
|
# Clear the queue of any previous emails first
|
260
261
|
if perform
|
261
262
|
assert_email_perform_enqueued_jobs
|
262
263
|
raise('expected empty mailer queue. unable to clear it.') unless (assert_email_perform_enqueued_jobs.to_i == 0)
|
264
|
+
end
|
263
265
|
|
266
|
+
if clear
|
264
267
|
ActionMailer::Base.deliveries.clear
|
265
268
|
raise('expected empty mailer deliveries. unable to clear it.') unless (ActionMailer::Base.deliveries.length.to_i == 0)
|
266
269
|
end
|
@@ -280,6 +283,8 @@ module EffectiveTestBotAssertions
|
|
280
283
|
end
|
281
284
|
end
|
282
285
|
|
286
|
+
return true if count == 0
|
287
|
+
|
283
288
|
if (action || to || from || subject || body || plain_layout || html_layout).nil?
|
284
289
|
assert ActionMailer::Base.deliveries.present?, message || "(assert_email) Expected email to have been delivered"
|
285
290
|
return retval
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_test_bot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-06-
|
11
|
+
date: 2024-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|