]> Sergey Matveev's repositories - public-inbox.git/commitdiff
t/www_listing: test "all" HTML listing
authorEric Wong <e@80x24.org>
Thu, 26 Dec 2019 06:48:03 +0000 (06:48 +0000)
committerEric Wong <e@80x24.org>
Thu, 26 Dec 2019 07:27:02 +0000 (07:27 +0000)
We now have coverage for PublicInbox::WwwListing::list_all.

t/www_listing.t

index 2ff053dedd01bfd0a605b2b698f8556f2c9bed8b..e785ae9b0e443233dac55ce30c367a2322a9f565 100644 (file)
@@ -31,7 +31,10 @@ like(PublicInbox::WwwListing::fingerprint($bare), qr/\A[a-f0-9]{40}\z/,
 sub tiny_test {
        my ($json, $host, $port) = @_;
        my $http = HTTP::Tiny->new;
-       my $res = $http->get("http://$host:$port/manifest.js.gz");
+       my $res = $http->get("http://$host:$port/");
+       is($res->{status}, 200, 'got HTML listing');
+       like($res->{content}, qr!</html>!si, 'listing looks like HTML');
+       $res = $http->get("http://$host:$port/manifest.js.gz");
        is($res->{status}, 200, 'got manifest');
        my $tmp;
        IO::Uncompress::Gunzip::gunzip(\(delete $res->{content}) => \$tmp);
@@ -85,6 +88,8 @@ SKIP: {
        ok(unlink("$bare->{git_dir}/description"), 'removed bare/description');
        open $fh, '>', $cfgfile or die;
        print $fh <<"" or die;
+[publicinbox]
+       wwwlisting = all
 [publicinbox "bare"]
        inboxdir = $bare->{git_dir}
        url = http://$host/bare