| 65 | | $wiki->write_node( "Non-existent categories and locales", "foo", undef, |
| 66 | | { category => [ "Does not exist" ], |
| 67 | | locale => [ "Does not exist" ] } ); |
| | 67 | # Write a node, then delete one each of its categories and locales. |
| | 68 | OpenGuides::Test->write_data( |
| | 69 | guide => $guide, |
| | 70 | node => "Non-existent categories and locales", |
| | 71 | categories => "Does Not Exist\r\nDoes Exist", |
| | 72 | locales => "Does Not Exist\r\nDoes Exist", |
| | 73 | return_output => 1, |
| | 74 | ); |
| | 75 | foreach my $id ( ( "Category Does Not Exist", "Locale Does Not Exist" ) ) { |
| | 76 | $guide->delete_node( |
| | 77 | id => $id, |
| | 78 | password => "password", |
| | 79 | return_output => 1, |
| | 80 | ); |
| | 81 | } |
| 74 | | 'Category name not linked if category does not exist' ); |
| | 89 | "category name not linked if category does not exist" ); |
| | 90 | like( $output, qr{\Q<a href="wiki.cgi?Category_Does_Exist"}, |
| | 91 | "...but does when it does exist" ); |
| | 92 | unlike( $output, qr{\Q<a href="wiki.cgi?Locale_Does_Not_Exist"}, |
| | 93 | "locale name not linked if category does not exist" ); |
| | 94 | like( $output, qr{\Q<a href="wiki.cgi?Locale_Does_Exist"}, |
| | 95 | "...but does when it does exist" ); |
| 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 | | |
| | 109 | like( $output, qr{\Q<a href="wiki.cgi?Category_Does_Exist"}, |
| | 110 | "wrongly-cased categories are linked as they should be" ); |
| | 111 | like( $output, qr{\Q<a href="wiki.cgi?Locale_Does_Exist"}, |
| | 112 | "wrongly-cased locales are linked as they should be" ); |