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

Last change on this file since 949 was 949, checked in by Earle Martin, 15 years ago

Use skip_all for tests relying entirely on SQLite, instead of issuing skip commands with duplicate test counts and causing maintenance overhead.

  • 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;
5
6eval { require DBD::SQLite; };
7
8if ($@) {
9    plan skip_all => "DBD::SQLite not installed - no database to test with";
10} else {
11    plan tests => 2;
12}
13
14SKIP: {
15    Wiki::Toolkit::Setup::SQLite::cleardb( { dbname => "t/node.db" } );
16    Wiki::Toolkit::Setup::SQLite::setup( { dbname => "t/node.db" } );
17    my $config = OpenGuides::Test->make_basic_config;
18    $config->script_name( "mywiki.cgi" );
19    $config->script_url( "http://example.com/" );
20    my $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";
23    my %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
26    my $output = $guide->display_node(
27                                       id => "South Croydon Station",
28                                       version => 1,
29                                       return_output => 1,
30                                     );
31    like( $output, qr'South_Croydon_Station',
32          "node param escaped properly in links in historic view" );
33    unlike( $output, qr'South%20Croydon%20Station',
34            "...in all links" );
35}
36
Note: See TracBrowser for help on using the repository browser.