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: 5d6c35e391f98542191fd633aa5b1969e90657ceb2b5fe872e7735184c392a71
4
- data.tar.gz: dcd72ecee5a4e73dfee52a068166010f54c1c30b96ca1305c88fbe824987d8ee
3
+ metadata.gz: 9203029533864033577b0e25871a22cc59ddfe75fc7008dbaccc55f4bf3b6780
4
+ data.tar.gz: 8749084f4ffc48685415c59101ca39f8bc43a59434a0de94ae440e16a7f3a6fa
5
5
  SHA512:
6
- metadata.gz: 38f0da58d5f36f2e45121ddcdf1adbd8bd2f022eb9bec14311f5951b24f9bcddb21a54c33f64d789d3b3d02987d7cb140cde357302b4cf5c6501cb6f6c6260a0
7
- data.tar.gz: 4b1adb6b0a0ce8408f40fb0090b7646099925f887b2c6e0910798bb8601123f5c8dd83d02534b60a2720bed76cd1bf6293e85aa42314389aadcf4c456081bb5f
6
+ metadata.gz: fb9e3634e05de135efb68e4090c1866c68fedede2bd368334b0984a9b37132d1ac5bd689f7edec09f62b2cebaa326b95105bf4ed9fda31c06ca1b51c87c81f66
7
+ data.tar.gz: 5278bb90f77e4c54ff1c5ac6fafde73d7e7fd047e773efb35a0e3a14718f00acd4515f8e41bbcea26dcea7997f86626499156f9e48a2903c79bbd1505ee605d3
@@ -1,3 +1,3 @@
1
1
  module EffectiveTestBot
2
- VERSION = '1.5.10'.freeze
2
+ VERSION = '1.5.12'.freeze
3
3
  end
@@ -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.10
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-24 00:00:00.000000000 Z
11
+ date: 2024-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails