From 6561f886ed03a79ca035a1733816ab97380576d2 Mon Sep 17 00:00:00 2001 From: Patrick J Cherry Date: Mon, 23 Apr 2012 16:01:44 +0100 Subject: Persons/PeopleLists can now specify multiple notification preferences. --- test/tc_mauve_notification.rb | 76 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) (limited to 'test/tc_mauve_notification.rb') diff --git a/test/tc_mauve_notification.rb b/test/tc_mauve_notification.rb index 7ff0d79..16b6489 100644 --- a/test/tc_mauve_notification.rb +++ b/test/tc_mauve_notification.rb @@ -403,4 +403,80 @@ EOF end + def test_individual_notification_preferences + config=< "test", + :source => "test", + :subject => "test" + ) + + # + # This should only alert test1 + # + alert.raise! + assert_equal(1, notification_buffer.size, "Wrong number of notifications sent") + assert_equal("test1@example.com", notification_buffer.pop[2]) + + alert.clear! + assert_equal(1, notification_buffer.size, "Wrong number of notifications sent") + assert_equal("test1@example.com", notification_buffer.pop[2]) + + # + # Wind forward to 9am (working hours) + # + Timecop.freeze(Time.now+9.hours) + assert(Time.now.working_hours?) + alert.raise! + assert_equal(1, notification_buffer.size, "Wrong number of notifications sent") + assert_equal("test2@example.com", notification_buffer.pop[2]) + + alert.clear! + assert_equal(1, notification_buffer.size, "Wrong number of notifications sent") + assert_equal("test2@example.com", notification_buffer.pop[2]) + + + end + end -- cgit v1.2.1