RT 4.0.22
[freeside.git] / rt / t / security / CVE-2011-2083-scrub.t
1 use strict;
2 use warnings;
3
4 use RT::Test nodb => 1, tests => undef;
5 use RT::Interface::Web; # This gets us HTML::Mason::Commands
6 use Test::LongString;
7
8 {
9     my $html = '<div id="metadata"><span class="actions"><a>OH HAI</a></span></div><p>Moose</p>';
10     my $expected = '<div><span><a>OH HAI</a></span></div><p>Moose</p>';
11     is_string(scrub_html($html), $expected, "class and id are stripped");
12 }
13
14 sub scrub_html {
15     return HTML::Mason::Commands::ScrubHTML(shift);
16 }
17
18 done_testing;