Changeset 1236 for trunk/t/13_cookies.t

Show
Ignore:
Timestamp:
10/19/08 16:24:04 (3 months ago)
Author:
dom
Message:

Add an admin navbar, to be displayed if the user requests (fixes #261)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/t/13_cookies.t

    r953 r1236  
    44use Time::Piece; 
    55use Time::Seconds; 
    6 use Test::More tests => 27; 
     6use Test::More tests => 29; 
    77 
    88eval { OpenGuides::CGI->make_prefs_cookie; }; 
     
    3131    track_recent_changes_views => "rc_pref", 
    3232    display_google_maps        => "gm_pref", 
     33    is_admin                   => "admin_pref", 
    3334); 
    3435isa_ok( $cookie, "CGI::Cookie", "->make_prefs_cookie returns a cookie" ); 
     
    6970is( $prefs{display_google_maps}, "gm_pref", 
    7071                                     "...and Google Maps display preference" ); 
    71  
     72is( $prefs{is_admin}, "admin_pref", 
     73                                     "...and admin preference" ); 
    7274# Now make sure that true/false preferences are taken account of when 
    7375# they're false. 
     
    8183    track_recent_changes_views => 0, 
    8284    display_google_maps        => 0, 
     85    is_admin                   => 0, 
    8386); 
    8487 
     
    9396ok( !$prefs{track_recent_changes_views}, "...and recent changes prefs" ); 
    9497ok( !$prefs{display_google_maps}, "...and Google Maps prefs" ); 
     98ok( !$prefs{is_admin}, "...and admin prefs" ); 
    9599 
    96100# Check that cookie parsing fails nicely if no cookie set. 
     
    98102%prefs = eval { OpenGuides::CGI->get_prefs_from_cookie( config => $config ); }; 
    99103is( $@, "", "->get_prefs_from_cookie doesn't die if no cookie set" ); 
    100 is( keys %prefs, 10, "...and returns ten default values" ); 
     104is( keys %prefs, 11, "...and returns ten default values" );