]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/plack.t
update copyrights for 2021
[public-inbox.git] / t / plack.t
index 37a6b39486e06ea1e4fc575893c3de96e09bc7f1..8d8aa10088d1c0b8afafb33f101de38a08410d6f 100644 (file)
--- a/t/plack.t
+++ b/t/plack.t
@@ -1,4 +1,4 @@
-# Copyright (C) 2014-2020 all contributors <meta@public-inbox.org>
+# Copyright (C) 2014-2021 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 use strict;
 use warnings;
@@ -21,8 +21,8 @@ ok(-f $psgi, "psgi example file found");
 my $pfx = 'http://example.com/test';
 ok(run_script(['-init', 'test', $inboxdir, "$pfx/", $addr]),
        'initialized repo');
-PublicInbox::Import::run_die([qw(git config -f), $pi_config,
-       'publicinbox.test.newsgroup', 'inbox.test']);
+xsys_e(qw(git config -f), $pi_config,
+       qw(publicinbox.test.newsgroup inbox.test));
 open my $fh, '>', "$inboxdir/description" or die "open: $!\n";
 print $fh "test for public-inbox\n";
 close $fh or die "close: $!\n";
@@ -45,7 +45,7 @@ EOF
        $im->add($mime);
        $im->done;
        my $rev = $git->qx(qw(rev-list HEAD));
-       like($rev, qr/\A[a-f0-9]{40}/, "good revision committed");
+       like($rev, qr/\A[a-f0-9]{40,}/, "good revision committed");
        @ls = $git->qx(qw(ls-tree -r --name-only HEAD));
        chomp @ls;
 
@@ -209,6 +209,10 @@ test_psgi($app, sub {
        my $res = $cb->(GET($pfx . '/blah@example.com/raw'));
        is(200, $res->code, 'success response received for /*/raw');
        like($res->content, qr!^From !sm, "mbox returned");
+
+       $res = $cb->(GET($pfx . '/blah@example.com/t.mbox.gz'));
+       is(501, $res->code, '501 when overview missing');
+       like($res->content, qr!\bOverview\b!, 'overview omission noted');
 });
 
 # legacy redirects