Module: AbstractNotifier::TestHelper

Defined in:
lib/abstract_notifier/testing/minitest.rb

Instance Method Summary collapse

Instance Method Details

#assert_notifications_enqueued(count, params) ⇒ Object



15
16
17
18
19
20
21
22
23
# File 'lib/abstract_notifier/testing/minitest.rb', line 15

def assert_notifications_enqueued(count, params)
  yield
  assert_equal enqueued_deliveries.count, count
  count.times do |i|
    delivery = enqueued_deliveries[0 - i]
    msg = message(msg) { "Expected #{mu_pp(delivery)} to include #{mu_pp(params)}" }
    assert hash_include?(delivery, params), msg
  end
end

#assert_notifications_sent(count, params) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/abstract_notifier/testing/minitest.rb', line 5

def assert_notifications_sent(count, params)
  yield
  assert_equal deliveries.count, count
  count.times do |i|
    delivery = deliveries[0 - i]
    msg = message(msg) { "Expected #{mu_pp(delivery)} to include #{mu_pp(params)}" }
    assert hash_include?(delivery, params), msg
  end
end