mirror of
https://github.com/Evolix/chexpire.git
synced 2024-06-26 19:12:53 +02:00
26 lines
609 B
Ruby
26 lines
609 B
Ruby
|
require "test_helper"
|
||
|
require "notifier"
|
||
|
|
||
|
class NotifierTest < ActiveSupport::TestCase
|
||
|
test "#process_all process expirable & failures notifications" do
|
||
|
mock = Minitest::Mock.new
|
||
|
mock.expect(:process_expires_soon, nil)
|
||
|
mock.expect(:process_recurrent_failures, nil)
|
||
|
|
||
|
myconfig = "test config"
|
||
|
|
||
|
assert_stub = lambda { |actual_config|
|
||
|
assert_equal myconfig, actual_config,
|
||
|
"Processor was not initialized with the expected configuration"
|
||
|
|
||
|
mock
|
||
|
}
|
||
|
|
||
|
Notifier::Processor.stub :new, assert_stub do
|
||
|
Notifier.process_all(myconfig)
|
||
|
end
|
||
|
|
||
|
mock.verify
|
||
|
end
|
||
|
end
|