Changeset 607 for trunk/t/15_template.t


Ignore:
Timestamp:
Jan 2, 2005, 2:06:44 AM (17 years ago)
Author:
Dominic Hargreaves
Message:

Allow configuration of external text formatting link

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/t/15_template.t

    r606 r607  
    66use OpenGuides::Template;
    77use Test::MockObject;
    8 use Test::More tests => 27;
     8use Test::More tests => 28;
    99
    1010my $config = OpenGuides::Config->new(
     
    2020                 home_name             => 'Home Page',
    2121                 formatting_rules_node => 'Rules',
     22                 formatting_rules_link => '',
    2223               }
    2324);
     
    112113like( $output, qr/Set-Cookie: $cookie/, "cookie in header" );
    113114
     115# Test that external URLs for text formatting work.
     116$config = OpenGuides::Config->new(
     117       vars => {
     118                 template_path         => cwd . '/t/templates',
     119                 site_name             => 'CGI::Wiki Test Site',
     120                 script_url            => 'http://wiki.example.com/',
     121                 script_name           => 'mywiki.cgi',
     122                 formatting_rules_node => 'Some External Help',
     123                 formatting_rules_link => 'http://www.example.com/wikitext',
     124               }
     125);
     126$output = OpenGuides::Template->output(
     127    wiki     => $fake_wiki,
     128    config   => $config,
     129    template => "15_test.tt"
     130);
     131like ( $output, qr/FORMATTING RULES LINK: http:\/\/www.example.com\/wikitext/,
     132      "formatting_rules_link var honoured for explicit URLs" );
     133
    114134# Test that home_link is set correctly when script_name is blank.
    115135$config = OpenGuides::Config->new(
Note: See TracChangeset for help on using the changeset viewer.