diff options
author | Patrick J Cherry <patrick@bytemark.co.uk> | 2012-12-12 10:46:58 +0000 |
---|---|---|
committer | Patrick J Cherry <patrick@bytemark.co.uk> | 2012-12-12 10:46:58 +0000 |
commit | be4a30ee02704b591f45fe12e1546739bf35f1cb (patch) | |
tree | 286dfa333a37b0ad6e02a86b1bd06d3e8063447c /test | |
parent | ac2fb2330a564ba52761ed2b06036c61fc9f07d6 (diff) |
Fixed up alert truncating only to work on strings. Added test case.
Diffstat (limited to 'test')
-rw-r--r-- | test/tc_mauve_alert.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/tc_mauve_alert.rb b/test/tc_mauve_alert.rb index 61bd117..5c6f2bd 100644 --- a/test/tc_mauve_alert.rb +++ b/test/tc_mauve_alert.rb @@ -475,4 +475,23 @@ EOF assert(!alert.suppressed?,"Alert marked as suppressed when the suppression period was never set") end + def test_long_fields_get_truncated + Configuration.current = ConfigurationBuilder.parse(@test_config) + Server.instance.setup + + alert = Alert.new( + :alert_id => "x"*257, + :source => "test", + :subject => "test" + ) + + assert(alert.save, "Alert with overly long field failed to save") + # This should trigger a warning. + logger_pop + + alert.reload + assert(256, alert.alert_id.length) + + end + end |