aboutsummaryrefslogtreecommitdiff
path: root/test/tc_mauve_alert.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/tc_mauve_alert.rb')
-rw-r--r--test/tc_mauve_alert.rb31
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