Author: kake Date: 2007-06-10 18:13:36 +0100 (Sun, 10 Jun 2007) New Revision: 1062
Modified: trunk/t/70_admin_home.t Log: Apply Andrew's patch, fixes #212 (uninitialised value warnings in test 70). Incidental change: use OpenGuides::Test->write_data instead of Wiki::Toolkit->write_node, hence change in number at line 59, since OpenGuides::Test autocreates categories and locales and Wiki::Toolkit doesn't.
Modified: trunk/t/70_admin_home.t =================================================================== --- trunk/t/70_admin_home.t 2007-06-10 16:29:52 UTC (rev 1061) +++ trunk/t/70_admin_home.t 2007-06-10 17:13:36 UTC (rev 1062) @@ -29,19 +29,26 @@
# Add 3 different pages, one of which with two versions -$wiki->write_node( "Test Page", "foo", undef, - { category => "Alpha" } ) - or die "Couldn't write node"; -$wiki->write_node( "Test Page 2", "foo", undef, - { category => "Alpha" } ) - or die "Couldn't write node"; -$wiki->write_node( "Locale Bar", "foo", undef, - { category => "Locales" } ) - or die "Couldn't write locale"; -my %data = $wiki->retrieve_node( "Locale Bar" ); -$wiki->write_node( "Locale Bar", "foo version 2", $data{checksum}, - { category => "Locales" } ) - or die "Couldn't write locale for the 2nd time"; +OpenGuides::Test->write_data( + guide => $guide, + node => "Test Page", + categories => "Alpha", + return_output => 1 ); +OpenGuides::Test->write_data( + guide => $guide, + node => "Test Page 2", + categories => "Alpha", + return_output => 1 ); +OpenGuides::Test->write_data( + guide => $guide, + node => "Locale Bar", + categories => "Locales", + return_output => 1 ); +OpenGuides::Test->write_data( + guide => $guide, + node => "Locale Bar", + categories => "Locales", + return_output => 1 );
# Test the tt vars @@ -52,7 +59,7 @@
is( scalar @{$ttvars{'nodes'}}, 2, "Right number of nodes" ); is( scalar @{$ttvars{'locales'}}, 1, "Right number of locales" ); -is( scalar @{$ttvars{'categories'}}, 0, "Right number of categories" ); +is( scalar @{$ttvars{'categories'}}, 2, "Right number of categories" );
my @node_names = map { $_->{name}; } @{$ttvars{nodes}}; is_deeply( [ sort @node_names ], [ "Test Page", "Test Page 2" ], @@ -67,4 +74,4 @@
like( $output, qr|Site Administration|, "Right page" ); like( $output, qr|Test Page|, "Has nodes" ); -like( $output, qr|Bar|, "Has locales" ); \ No newline at end of file +like( $output, qr|Bar|, "Has locales" );