source: trunk/t/55_node_history.t @ 785

Last change on this file since 785 was 785, checked in by Dominic Hargreaves, 15 years ago

Use Wiki::Toolkit. Note that CGI::Wiki::Plugin::Diff hasn't been converted yet,
so tests will be broken for now.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.5 KB
Line 
1use Wiki::Toolkit::Setup::SQLite;
2use OpenGuides;
3use OpenGuides::Test;
4use Test::More tests => 2;
5
6eval { require DBD::SQLite; };
7my $have_sqlite = $@ ? 0 : 1;
8
9SKIP: {
10    skip "DBD::SQLite not installed - no database to test with", 2
11      unless $have_sqlite;
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::Test->make_basic_config;
16    $config->script_name( "mywiki.cgi" );
17    $config->script_url( "http://example.com/" );
18    my $guide = OpenGuides->new( config => $config );
19
20    $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";
21    my %data = $guide->wiki->retrieve_node( "South Croydon Station" );
22    $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";
23
24    my $output = $guide->display_node(
25                                       id => "South Croydon Station",
26                                       version => 1,
27                                       return_output => 1,
28                                     );
29    like( $output, qr'South_Croydon_Station',
30          "node param escaped properly in links in historic view" );
31    unlike( $output, qr'South%20Croydon%20Station',
32            "...in all links" );
33}
34
Note: See TracBrowser for help on using the repository browser.