|
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 | |
|---|
| 1 | use Wiki::Toolkit::Setup::SQLite; |
|---|
| 2 | use OpenGuides; |
|---|
| 3 | use OpenGuides::Test; |
|---|
| 4 | use Test::More; |
|---|
| 5 | |
|---|
| 6 | eval { require DBD::SQLite; }; |
|---|
| 7 | |
|---|
| 8 | if ( $@ ) { |
|---|
| 9 | my ($error) = $@ =~ /^(.*?)\n/; |
|---|
| 10 | plan skip_all => "DBD::SQLite could not be used - no database to test with ($error)"; |
|---|
| 11 | } |
|---|
| 12 | |
|---|
| 13 | plan tests => 2; |
|---|
| 14 | |
|---|
| 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" ); |
|---|