diff options
author | Patrick J Cherry <patrick@bytemark.co.uk> | 2012-05-09 17:05:15 +0100 |
---|---|---|
committer | Patrick J Cherry <patrick@bytemark.co.uk> | 2012-05-09 17:05:15 +0100 |
commit | 39cf220fcd2955faae798623164efc48a10b8417 (patch) | |
tree | 2128acd6141dee68e7247299c86ce481da0dadb2 /test | |
parent | 8d60bca4c43e386f74e44206fa6eb369e5fe5aae (diff) | |
parent | 196b337a02f959a431a4bb7c443ed116e4e291f3 (diff) |
merge
Diffstat (limited to 'test')
-rw-r--r-- | test/tc_mauve_alert.rb | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/test/tc_mauve_alert.rb b/test/tc_mauve_alert.rb index 3af9075..269bf4c 100644 --- a/test/tc_mauve_alert.rb +++ b/test/tc_mauve_alert.rb @@ -38,10 +38,6 @@ EOF super end - def test_alert_group - - end - # # This is also the test for in_source_list? @@ -292,4 +288,31 @@ EOF end + def test_destroy_history_on_destroy + Configuration.current = ConfigurationBuilder.parse(@test_config) + Server.instance.setup + + alert = Alert.new( + :alert_id => "test_no_notification_for_old_alerts", + :source => "test", + :subject => "test" + ) + alert.save + alert.raise! + alert.reload + assert_equal(1, History.all.length) + + + Timecop.freeze(Time.now + 5.minutes) + alert.clear! + assert_equal(2, History.all.length) + + # + # OK now we destroy the alert. Destory the histories too. + # + alert.destroy + assert_equal(0, History.all.length) + + end + end |