aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2011-01-22 22:23:50 +0000
committerSimon McVittie <smcv@debian.org>2011-01-22 22:23:50 +0000
commit0118479c9a8977ff3198622829ac4a0f3ea0de76 (patch)
tree06951ccfe11de966686257b7710ecd6bc3d2b52c
parente15e6cce6ca9eed6d0eabe6b9f100b713dcf2b59 (diff)
downloadikiwiki-0118479c9a8977ff3198622829ac4a0f3ea0de76.tar
ikiwiki-0118479c9a8977ff3198622829ac4a0f3ea0de76.tar.gz
autoindex.t: check that attachments cause indexing
-rwxr-xr-xt/autoindex.t12
1 files changed, 11 insertions, 1 deletions
diff --git a/t/autoindex.t b/t/autoindex.t
index f56a35269..b1425c22e 100755
--- a/t/autoindex.t
+++ b/t/autoindex.t
@@ -3,7 +3,7 @@ package IkiWiki;
use warnings;
use strict;
-use Test::More tests => 20;
+use Test::More tests => 22;
BEGIN { use_ok("IkiWiki"); }
BEGIN { use_ok("IkiWiki::Render"); }
@@ -52,6 +52,12 @@ $pagemtime{"has_internal/internal"} = 123456789;
$pagectime{"has_internal/internal"} = 123456789;
writefile("has_internal/internal._aggregated", "t/tmp", "this page is internal");
+# a directory containing only an attachment should be indexed
+$pagesources{"attached/pie.jpg"} = "attached/pie.jpg";
+$pagemtime{"attached/pie.jpg"} = 123456789;
+$pagectime{"attached/pie.jpg"} = 123456789;
+writefile("attached/pie.jpg", "t/tmp", "I lied, this isn't a real JPEG");
+
# "gone" disappeared just before this refresh pass so it still has a mtime
$pagemtime{gone} = $pagectime{gone} = 1000000;
@@ -81,4 +87,8 @@ ok(! -f "t/tmp/reinstated.mdwn");
ok(! exists $wikistate{autoindex}{deleted}{tags});
ok(-s "t/tmp/tags.mdwn");
+# needs creating because of an attachment
+ok(! exists $wikistate{autoindex}{deleted}{attached});
+ok(-s "t/tmp/attached.mdwn");
+
1;