root/branches/new-install-process/t/55_node_history.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;
3use OpenGuides::Test;
4use Test::More;
5
6eval { require DBD::SQLite; };
7
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 => 2;
14
15Wiki::Toolkit::Setup::SQLite::cleardb( { dbname => "t/node.db" } );
16Wiki::Toolkit::Setup::SQLite::setup( { dbname => "t/node.db" } );
17my $config = OpenGuides::Test->make_basic_config;
18$config->script_name( "mywiki.cgi" );
19$config->script_url( "http://example.com/" );
20my $guide = OpenGuides->new( config => $config );
21
22$guide->wiki->write_node( "South Croydon Station", "A sleepy main-line station in what is arguably the nicest part of Croydon.", undef, { comment => "<myfaketag>" } ) or die "Can't write node";
23my %data = $guide->wiki->retrieve_node( "South Croydon Station" );
24$guide->wiki->write_node( "South Croydon Station", "A sleepy main-line station in what is arguably the nicest part of Croydon.", $data{checksum}, { comment => "<myfaketag>" } ) or die "Can't write node";
25
26my $output = $guide->display_node(
27                                   id => "South Croydon Station",
28                                   version => 1,
29                                   return_output => 1,
30                                 );
31like( $output, qr'South_Croydon_Station',
32      "node param escaped properly in links in historic view" );
33unlike( $output, qr'South%20Croydon%20Station',
34        "...in all links" );
Note: See TracBrowser for help on using the browser.