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. --- .../tc_mauve_configuration_builders_people_list.rb | 11 ++-- test/tc_mauve_configuration_builders_person.rb | 11 ++-- test/tc_mauve_notification.rb | 76 ++++++++++++++++++++++ 3 files changed, 89 insertions(+), 9 deletions(-) (limited to 'test') diff --git a/test/tc_mauve_configuration_builders_people_list.rb b/test/tc_mauve_configuration_builders_people_list.rb index 61494d8..7e0840f 100644 --- a/test/tc_mauve_configuration_builders_people_list.rb +++ b/test/tc_mauve_configuration_builders_people_list.rb @@ -16,13 +16,13 @@ class TcMauveConfigurationBuildersPeopleList < Mauve::UnitTest def test_people_list 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