source: trunk/t/41_deletion.t @ 1042

Last change on this file since 1042 was 1042, checked in by kake, 14 years ago

Remove dependency on Test::MockObject?.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1007 bytes
Line 
1use strict;
2use OpenGuides;
3use OpenGuides::Template;
4use OpenGuides::Test;
5use Test::More tests => 3;
6
7my $config = OpenGuides::Test->make_basic_config;
8$config->site_name( "Test Site" );
9$config->script_url( "/" );
10
11my $guide = OpenGuides->new( config => $config );
12my $wiki = $guide->wiki;
13
14my $output = OpenGuides::Template->output(
15    wiki     => $wiki,
16    config   => $config,
17    template => "node.tt",
18);
19unlike( $output, qr/action=delete/,
20        "doesn't offer page deletion link by default" );
21$config->enable_page_deletion( "y" );
22$output = OpenGuides::Template->output(
23    wiki     => $wiki,
24    config   => $config,
25    template => "node.tt",
26);
27like( $output, qr/action=delete/,
28      "...but does when enable_page_deletion is set to 'y'" );
29$config->enable_page_deletion( 1 );
30$output = OpenGuides::Template->output(
31    wiki     => $wiki,
32    config   => $config,
33    template => "node.tt",
34);
35like( $output, qr/action=delete/,
36      "...and when enable_page_deletion is set to '1'" );
Note: See TracBrowser for help on using the repository browser.