aboutsummaryrefslogtreecommitdiff
path: root/test/tc_mauve_history.rb
blob: 62342f22cb252405436c0bbad76433fa029c1a52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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