Changeset 1243 for trunk/t/41_deletion.t


Ignore:
Timestamp:
Oct 22, 2008, 1:35:20 PM (13 years ago)
Author:
Dominic Hargreaves
Message:

Don't add delete links unless the user requests (fixes #159 - thanks bob)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/t/41_deletion.t

    r1042 r1243  
    33use OpenGuides::Template;
    44use OpenGuides::Test;
     5use OpenGuides::CGI;
    56use Test::More tests => 3;
    67
     
    2021        "doesn't offer page deletion link by default" );
    2122$config->enable_page_deletion( "y" );
     23    # set is_admin to 1
     24my $cookie = OpenGuides::CGI->make_prefs_cookie(
     25    config                     => $config,
     26    username                   => "bob",
     27    include_geocache_link      => 1,
     28    preview_above_edit_box     => 1,
     29    omit_help_links            => 1,
     30    show_minor_edits_in_rc     => 1,
     31    default_edit_type          => "tidying",
     32    cookie_expires             => "never",
     33    track_recent_changes_views => 1,
     34    is_admin => 1,
     35);
     36$ENV{HTTP_COOKIE} = $cookie;
     37
    2238$output = OpenGuides::Template->output(
    2339    wiki     => $wiki,
     
    2642);
    2743like( $output, qr/action=delete/,
    28       "...but does when enable_page_deletion is set to 'y'" );
     44      "...but does when enable_page_deletion is set to 'y' and is_admin is 1" );
    2945$config->enable_page_deletion( 1 );
    3046$output = OpenGuides::Template->output(
     
    3450);
    3551like( $output, qr/action=delete/,
    36       "...and when enable_page_deletion is set to '1'" );
     52      "...and when enable_page_deletion is set to '1' and is_admin is 1" );
Note: See TracChangeset for help on using the changeset viewer.