]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/cgi.t
implement per-thread Atom feeds
[public-inbox.git] / t / cgi.t
diff --git a/t/cgi.t b/t/cgi.t
index fc28ae30e08b7cfdf0bbad0dafd3118dc725d9a8..d84e63487a43a367f89e796caf03260faa0159e6 100644 (file)
--- a/t/cgi.t
+++ b/t/cgi.t
@@ -200,6 +200,18 @@ EOF
        } else {
                like($res->{head}, qr/^Status: 501 /, "search not available");
        }
+
+       my $have_xml_feed = eval { require XML::Feed; 1 } if $indexed;
+       if ($have_xml_feed) {
+               $path = "/test/t/blahblah%40example.com/atom";
+               $res = cgi_run($path);
+               like($res->{head}, qr/^Status: 200 /, "atom returned 200");
+               like($res->{head}, qr!^Content-Type: application/xml!m,
+                       "search returned atom");
+               my $p = XML::Feed->parse(\($res->{body}));
+               is($p->format, "Atom", "parsed atom feed");
+               is(scalar $p->entries, 3, "parsed three entries");
+       }
 }
 
 # redirect list-name-only URLs