source: trunk/t/63_bug_map_link_no_address.t @ 366

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

Fix template bug - map link wasn't showing up when there was no address. Added a test too.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.4 KB
Line 
1use CGI::Wiki::Setup::SQLite;
2use Config::Tiny;
3use Cwd;
4use OpenGuides;
5use Test::More tests => 1;
6
7eval { require DBD::SQLite; };
8my $have_sqlite = $@ ? 0 : 1;
9
10SKIP: {
11    skip "DBD::SQLite not installed - no database to test with", 1
12      unless $have_sqlite;
13
14    CGI::Wiki::Setup::SQLite::setup( { dbname => "t/node.db" } );
15    my $config = Config::Tiny->new;
16    $config->{_} = {
17                     dbtype             => "sqlite",
18                     dbname             => "t/node.db",
19                     indexing_directory => "t/indexes",
20                     script_url         => "http://wiki.example.com/",
21                     script_name        => "mywiki.cgi",
22                     site_name          => "CGI::Wiki Test Site",
23                     template_path      => cwd . "/templates",
24                   };
25
26    my $guide = OpenGuides->new( config => $config );
27
28    $guide->wiki->write_node( "South Croydon Station", "A sleepy main-line station in what is arguably the nicest part of Croydon.", undef, { map_link => "http://www.streetmap.co.uk/newmap.srf?x=532804&y=164398&z=1" } );
29
30    my $output = $guide->display_node(
31                                       id => "South Croydon Station",
32                                       return_output => 1,
33                                     );
34    like( $output, qr/Map:/, "map link included when no address" );
35}
36
Note: See TracBrowser for help on using the repository browser.