root/tags/rel0_58/t/65_bug_metadata_escape.t
| Revision 785, 1.5 kB (checked in by dom, 3 years ago) | |
|---|---|
|
|
| Line | |
|---|---|
| 1 | use Wiki::Toolkit::Setup::SQLite; |
| 2 | use OpenGuides::Config; |
| 3 | use Cwd; |
| 4 | use OpenGuides; |
| 5 | use Test::More; |
| 6 | |
| 7 | eval { require DBD::SQLite; }; |
| 8 | if ( $@ ) { |
| 9 | plan skip_all => "DBD:SQLite not installed"; |
| 10 | } else { |
| 11 | plan tests => 1; |
| 12 | |
| 13 | Wiki::Toolkit::Setup::SQLite::cleardb( { dbname => "t/node.db" } ); |
| 14 | Wiki::Toolkit::Setup::SQLite::setup( { dbname => "t/node.db" } ); |
| 15 | my $config = OpenGuides::Config->new( |
| 16 | vars => { |
| 17 | dbtype => "sqlite", |
| 18 | dbname => "t/node.db", |
| 19 | indexing_directory => "t/indexes", |
| 20 | script_url => "http://wiki.example.com/", |
| 21 | script_name => "mywiki.cgi", |
| 22 | site_name => "Wiki::Toolkit Test Site", |
| 23 | template_path => cwd . "/templates", |
| 24 | } |
| 25 | ); |
| 26 | eval { require Wiki::Toolkit::Search::Plucene; }; |
| 27 | if ( $@ ) { $config->use_plucene ( 0 ) }; |
| 28 | |
| 29 | my $guide = OpenGuides->new( config => $config ); |
| 30 | |
| 31 | $guide->wiki->write_node( "South Croydon Station", "A sleepy main-line station in what is arguably the nicest part of Croydon.", undef, { phone => "<hr><h1>hello mum</h1><hr>" } ) or die "Can't write node"; |
| 32 | |
| 33 | my $output = $guide->display_node( |
| 34 | id => "South Croydon Station", |
| 35 | return_output => 1, |
| 36 | ); |
| 37 | unlike( $output, qr'<hr><h1>hello mum</h1><hr>', |
| 38 | "HTML escaped in metadata on node display" ); |
| 39 | } |
Note: See TracBrowser
for help on using the browser.
