aboutsummaryrefslogtreecommitdiff
path: root/test/tc_mauve_history.rb
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2011-08-19 16:28:37 +0100
committerPatrick J Cherry <patrick@bytemark.co.uk>2011-08-19 16:28:37 +0100
commitcdb78656916abe5adb946a25b913cda7785a42de (patch)
tree0f656d639868c2ac8d8a14a5370ab8f2263092dc /test/tc_mauve_history.rb
parent8d209c0f6a1b3c47f9bc55b6f63cb14bfa935162 (diff)
HTML now sanitised on save.
Added History tests Default polling interval now 5s, 0s for Timer/UDPServer Fixed note entry for alert page.
Diffstat (limited to 'test/tc_mauve_history.rb')
-rw-r--r--test/tc_mauve_history.rb36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/tc_mauve_history.rb b/test/tc_mauve_history.rb
new file mode 100644
index 0000000..62342f2
--- /dev/null
+++ b/test/tc_mauve_history.rb
@@ -0,0 +1,36 @@
+$:.unshift "../lib"
+
+require 'th_mauve'
+require 'mauve/history'
+require 'mauve/server'
+
+class TcMauveHistory < Mauve::UnitTest
+
+ include Mauve
+
+ def setup
+ super
+ setup_database
+ end
+
+ def teardown
+ teardown_database
+ super
+ end
+
+ def test_save
+ Server.instance.setup
+ #
+ # Make sure events save without nasty html
+ #
+ h = History.new(:alerts => [], :type => "note", :event => "Hello <script>alert(\"arse\");</script>")
+
+ h.save
+ h.reload
+ assert_equal("Hello ",h.event, "HTML not stripped correctly on save.")
+ end
+end
+
+
+
+