effective_test_bot 1.5.10 → 1.5.11
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: ff3684f4325c106f954588537160bf2adb098f279cef78bda3973c3e7ed6b518
|
4
|
+
data.tar.gz: 1c46b71f6cb039f06433fc2577ed02d74e075b90774b4cd37c4170e82e0f75fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51f8ee341063d10213250224a5266d46ce2ac8dcf05e123c5d53afb0ef1b0c5dcde375cea28596c17b656007787d78222dc2ee9d6a824b361b087e25cdf72de3
|
7
|
+
data.tar.gz: 5d4790594fa21013f9f44c5cf5b9b2ac946394d887efc02c813ee992fb4268832eeee0824ad33db7a2732ad5fdc338f5954e47210c8e4bf539e2967f1e76e760
|
@@ -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
|