source: trunk/t/67_bug_first_version.t @ 603

Last change on this file since 603 was 603, checked in by kake, 17 years ago

Oops, this should be in CVS.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.2 KB
Line 
1use CGI::Wiki::Setup::SQLite;
2use OpenGuides::Config;
3use OpenGuides;
4use OpenGuides::Template;
5use OpenGuides::Test;
6use Test::More;
7
8eval { require DBD::SQLite; };
9if ( $@ ) {
10    plan skip_all => "DBD::SQLite not installed";
11    exit 0;
12}
13
14plan tests => 3;
15
16# Clear out the database from any previous runs.
17unlink "t/node.db";
18unlink <t/indexes/*>;
19CGI::Wiki::Setup::SQLite::setup( { dbname => "t/node.db" } );
20
21my $config = OpenGuides::Test->make_basic_config;
22my $guide = OpenGuides->new( config => $config );
23
24OpenGuides::Test->write_data(
25                              guide => $guide,
26                              node  => "A Node",
27);
28
29# Test that we can list all versions of a node that only has one version.
30eval { $guide->list_all_versions( id => "A Node", return_output => 1 ); };
31is( $@, "", "->list_all_versions doesn't croak when only one version" );
32
33# Test that node with only one version doesn't display diff link.
34my $output = $guide->display_node( id => "A Node", return_output => 1 );
35unlike( $output, qr|<a href=".*">diff</a>|,
36        "no diff link displayed on node with only one version" );
37unlike( $output, qr|<a href=".*">View current version.</a>|i,
38        "...nor view current version link" );
Note: See TracBrowser for help on using the repository browser.