| | 64 | |
| | 65 | $wiki->write_node( "Non-existent categories and locales", "foo", undef, |
| | 66 | { category => [ "Does not exist" ], |
| | 67 | locale => [ "Does not exist" ] } ); |
| | 68 | |
| | 69 | $output = $guide->display_node( id => 'Non-existent categories and locales', |
| | 70 | return_output => 1 |
| | 71 | ); |
| | 72 | |
| | 73 | unlike( $output, qr{\Q<a href="wiki.cgi?Category_Does_Not_Exist"}, |
| | 74 | 'Category name not linked if category does not exist' ); |
| | 75 | |
| | 76 | $wiki->write_node( "Category_Does_Not_Exist", "bar", undef, undef ); |
| | 77 | |
| | 78 | $output = $guide->display_node( id => 'Non-existent categories and locales', |
| | 79 | return_output => 1 |
| | 80 | ); |
| | 81 | |
| | 82 | like( $output, qr{\Q<a href="wiki.cgi?Category_Does_Not_Exist"}, |
| | 83 | 'but does when it does exist' ); |
| | 84 | |
| | 85 | unlike( $output, qr{\Q<a href="wiki.cgi?Locale_Does_Not_Exist"}, |
| | 86 | 'Locale name not linked if category does not exist' ); |
| | 87 | |
| | 88 | $wiki->write_node( "Locale_Does_Not_Exist", "wibble", undef, undef ); |
| | 89 | |
| | 90 | $output = $guide->display_node( id => 'Non-existent categories and locales', |
| | 91 | return_output => 1 |
| | 92 | ); |
| | 93 | |
| | 94 | like( $output, qr{\Q<a href="wiki.cgi?Locale_Does_Not_Exist"}, |
| | 95 | 'but does when it does exist' ); |
| | 96 | |
| | 97 | |