aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2019-02-03 16:06:36 +0000
committerSimon McVittie <smcv@debian.org>2019-02-03 16:18:18 +0000
commit278678b42f16391c8fea83ff29eee5fc7875b991 (patch)
treed5150a41fc769ba726e4bb84855f0f59377650d1 /t
parent4ac930380b434fcbe1fbfa29f474591cf4bebf69 (diff)
downloadikiwiki-278678b42f16391c8fea83ff29eee5fc7875b991.tar
ikiwiki-278678b42f16391c8fea83ff29eee5fc7875b991.tar.gz
comments.t: Assert that comments get permalink metadata
Signed-off-by: Simon McVittie <smcv@debian.org>
Diffstat (limited to 't')
-rwxr-xr-xt/comments.t14
-rw-r--r--t/tinyblog/post.mdwn2
2 files changed, 15 insertions, 1 deletions
diff --git a/t/comments.t b/t/comments.t
index 9bc40b66a..fc87d72ff 100755
--- a/t/comments.t
+++ b/t/comments.t
@@ -68,6 +68,18 @@ sub slurp {
my $content = slurp("t/tmp/out/post/index.html");
ok(defined $content);
-ok($content =~ m/I conquered.*I explored.*I landed/s);
+like($content, qr/I conquered.*I explored.*I landed/s);
+
+$content = slurp("t/tmp/out/post/index.atom");
+ok(defined $content);
+like($content, qr{
+ <link\s*href="http://example\.com/post/[#]comment-[[:xdigit:]]+"
+ .*
+ <link\s*href="http://example\.com/post/[#]comment-[[:xdigit:]]+"
+ .*
+ <link\s*href="http://example\.com/post/[#]comment-[[:xdigit:]]+"
+}sx, 'Each comment gets an appropriate permalink in <link>');
+unlike($content, qr{<link\s*href=.*/post/comment_[123]/});
+unlike($content, qr{<link\s*href=.*/post/comment_[123]_[[:xdigit:]]+/});
done_testing();
diff --git a/t/tinyblog/post.mdwn b/t/tinyblog/post.mdwn
index 9eaeec7ef..993155b45 100644
--- a/t/tinyblog/post.mdwn
+++ b/t/tinyblog/post.mdwn
@@ -1 +1,3 @@
only post
+
+[[!inline pages="internal(post/comment_*)" atom="yes" rss="no" feedonly="yes"]]