Ticket #212: 70_admin_home.t.patch
| File 70_admin_home.t.patch, 2.0 kB (added by andrewb, 18 months ago) |
|---|
-
70_admin_home.t
29 29 30 30 31 31 # Add 3 different pages, one of which with two versions 32 $wiki->write_node( "Test Page", "foo", undef, 33 { category => "Alpha" } ) 32 OpenGuides::Test->write_data( 33 guide => $guide, 34 node => "Test Page", 35 categories => "Alpha" ) 34 36 or die "Couldn't write node"; 35 $wiki->write_node( "Test Page 2", "foo", undef, 36 { category => "Alpha" } ) 37 OpenGuides::Test->write_data( 38 guide => $guide, 39 node => "Test Page 2", 40 categories => "Alpha" ) 37 41 or die "Couldn't write node"; 38 $wiki->write_node( "Locale Bar", "foo", undef, 39 { category => "Locales" } ) 42 OpenGuides::Test->write_data( 43 guide => $guide, 44 node => "Locale Bar", 45 categories => "Locales" ) 40 46 or die "Couldn't write locale"; 41 my %data = $wiki->retrieve_node( "Locale Bar" ); 42 $wiki->write_node( "Locale Bar", "foo version 2", $data{checksum}, 43 { category => "Locales" } ) 47 OpenGuides::Test->write_data( 48 guide => $guide, 49 node => "Locale Bar", 50 categories => "Locales" ) 44 51 or die "Couldn't write locale for the 2nd time"; 45 52 46 53 … … 52 59 53 60 is( scalar @{$ttvars{'nodes'}}, 2, "Right number of nodes" ); 54 61 is( scalar @{$ttvars{'locales'}}, 1, "Right number of locales" ); 55 is( scalar @{$ttvars{'categories'}}, 0, "Right number of categories" );62 is( scalar @{$ttvars{'categories'}}, 2, "Right number of categories" ); 56 63 57 64 my @node_names = map { $_->{name}; } @{$ttvars{nodes}}; 58 65 is_deeply( [ sort @node_names ], [ "Test Page", "Test Page 2" ], … … 67 74 68 75 like( $output, qr|Site Administration|, "Right page" ); 69 76 like( $output, qr|Test Page|, "Has nodes" ); 70 like( $output, qr|Bar|, "Has locales" ); 71 No newline at end of file 77 like( $output, qr|Bar|, "Has locales" );
