X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fwww_listing.t;h=9230329ccd79650c4165d6623351c99142efd638;hb=6ebcec3add4d6aeff6e3b3eb019a404528c079ec;hp=2ff053dedd01bfd0a605b2b698f8556f2c9bed8b;hpb=39ac2f20f40c202b9ef0278c477cd4ba91573163;p=public-inbox.git diff --git a/t/www_listing.t b/t/www_listing.t index 2ff053de..9230329c 100644 --- a/t/www_listing.t +++ b/t/www_listing.t @@ -1,4 +1,4 @@ -# Copyright (C) 2019 all contributors +# Copyright (C) 2019-2020 all contributors # License: AGPL-3.0+ # manifest.js.gz generation and grok-pull integration test use strict; @@ -9,8 +9,10 @@ use PublicInbox::TestCommon; require_mods(qw(URI::Escape Plack::Builder Digest::SHA IO::Compress::Gzip IO::Uncompress::Gunzip HTTP::Tiny)); require PublicInbox::WwwListing; -my $json = eval { PublicInbox::WwwListing::_json() }; -plan skip_all => "JSON module missing: $@" if $@; +my $json = do { + no warnings 'once'; + $PublicInbox::WwwListing::json; +} or plan skip_all => "JSON module missing"; use_ok 'PublicInbox::Git'; @@ -31,7 +33,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!!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 +90,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