forked from github/kensanata.oddmuse
Fix encoding menu disappears if page is missing.
This commit is contained in:
@@ -14,15 +14,18 @@
|
||||
|
||||
require 't/test.pl';
|
||||
package OddMuse;
|
||||
use Test::More tests => 11;
|
||||
use Test::More tests => 12;
|
||||
use utf8; # tests contain UTF-8 characters and it matters
|
||||
|
||||
clear_pages();
|
||||
add_module('fix-encoding.pl');
|
||||
|
||||
# make sure the menu only shows up if it applies to a page
|
||||
# make sure no menu shows if no page is provided
|
||||
|
||||
test_page_negative(get_page('action=admin'), 'action=fix-encoding');
|
||||
|
||||
# make sure no menu shows up if the page does not exists
|
||||
|
||||
test_page(get_page('action=admin id=foo'), 'action=fix-encoding;id=foo');
|
||||
|
||||
# make sure nothing is saved if the page does not exist
|
||||
@@ -42,9 +45,15 @@ test_page(get_page('action=fix-encoding id=Example'),
|
||||
|
||||
test_page_negative(get_page('action=rc showedit=1'), 'fix encoding');
|
||||
|
||||
# the menu shows up if the page exists
|
||||
|
||||
test_page(get_page('action=admin id=Example'),
|
||||
'action=fix-encoding;id=Example');
|
||||
|
||||
# here is an actual page you need to fix
|
||||
|
||||
test_page(update_page('Example', 'Pilgerstätte für die Göttin', 'borked encoding'),
|
||||
test_page(update_page('Example', 'Pilgerstätte für die Göttin',
|
||||
'borked encoding'),
|
||||
'Pilgerstätte für die Göttin');
|
||||
|
||||
test_page(get_page('action=fix-encoding id=Example'),
|
||||
|
||||
Reference in New Issue
Block a user