root/tags/rel0_59/t/65_bug_metadata_escape.t

Revision 956, 1.5 kB (checked in by earle, 22 months ago)

Complete transition to using skip_all (remove old SKIP blocks).
More verbose reporting for error "require"ing DBD::SQLite.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1use Wiki::Toolkit::Setup::SQLite;
2use OpenGuides::Config;
3use Cwd;
4use OpenGuides;
5use Test::More;
6
7eval { require DBD::SQLite; };
8if ( $@ ) {
9    my ($error) = $@ =~ /^(.*?)\n/;
10    plan skip_all => "DBD::SQLite could not be used - no database to test with ($error)";
11}
12
13plan tests => 1;
14
15Wiki::Toolkit::Setup::SQLite::cleardb( { dbname => "t/node.db" } );
16Wiki::Toolkit::Setup::SQLite::setup( { dbname => "t/node.db" } );
17my $config = OpenGuides::Config->new(
18       vars => {
19                 dbtype             => "sqlite",
20                 dbname             => "t/node.db",
21                 indexing_directory => "t/indexes",
22                 script_url         => "http://wiki.example.com/",
23                 script_name        => "mywiki.cgi",
24                 site_name          => "Wiki::Toolkit Test Site",
25                 template_path      => cwd . "/templates",
26               }
27);
28eval { require Wiki::Toolkit::Search::Plucene; };
29if ( $@ ) { $config->use_plucene ( 0 ) };
30
31my $guide = OpenGuides->new( config => $config );
32
33$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";
34
35my $output = $guide->display_node(
36                                   id => "South Croydon Station",
37                                   return_output => 1,
38                                 );
39unlike( $output, qr'<hr><h1>hello mum</h1><hr>',
40        "HTML escaped in metadata on node display" );
Note: See TracBrowser for help on using the browser.