]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/extindex-psgi.t
lei: propagate keyword changes from lei/store
[public-inbox.git] / t / extindex-psgi.t
index b9acc9793292b6d3b7a7189853c01b75af186279..4e26962e06c923b4b31901933eed61854bf3d07d 100644 (file)
@@ -28,6 +28,8 @@ run_script([qw(-extindex --all), "$tmpdir/eidx"], $env) or BAIL_OUT;
 [extindex "all"]
        topdir = $tmpdir/eidx
        url = http://bogus.example.com/all
+[publicinbox]
+       wwwlisting = all
 EOM
 }
 my $www = PublicInbox::WWW->new(PublicInbox::Config->new($pi_config));
@@ -52,6 +54,19 @@ my $client = sub {
        my $cfg = PublicInbox::Config->git_config_dump($f);
        is($?, 0, 'no errors from git-config parsing');
        ok($cfg->{'extindex.all.topdir'}, 'extindex.topdir defined');
+
+       $res = $cb->(GET('/all/all.mbox.gz'));
+       is($res->code, 200, 'all.mbox.gz');
+
+       $res = $cb->(GET('/'));
+       like($res->content, qr!\Qhttp://bogus.example.com/all\E!,
+               '/all listed');
+       $res = $cb->(GET('/?q='));
+       is($res->code, 200, 'no query means all inboxes');
+       $res = $cb->(GET('/?q=nonexistent'));
+       is($res->code, 404, 'no inboxes matched');
+       unlike($res->content, qr!no inboxes, yet!,
+               'we have inboxes, just no matches');
 };
 test_psgi(sub { $www->call(@_) }, $client);
 %$env = (%$env, TMPDIR => $tmpdir, PI_CONFIG => $pi_config);