about summary refs log tree commit homepage
path: root/t/extindex-psgi.t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-08-27 12:08:45 +0000
committerEric Wong <e@80x24.org>2021-08-28 10:37:10 +0000
commit733a7405f5a9d24782093876f178c6eb954dc17c (patch)
tree090a959b059f486f28dc78ac3b471a9d2ece6ed7 /t/extindex-psgi.t
parentc08ecad116d24f642bb53634eb6243a54e3a20be (diff)
downloadpublic-inbox-733a7405f5a9d24782093876f178c6eb954dc17c.tar.gz
Searching inboxes with an empty query no longer gives 500 errors
due to Xapian.  Also, improve the error message when no inboxes
match, since saying no inboxes exist yet is wrong.
Diffstat (limited to 't/extindex-psgi.t')
-rw-r--r--t/extindex-psgi.t10
1 files changed, 8 insertions, 2 deletions
diff --git a/t/extindex-psgi.t b/t/extindex-psgi.t
index 31b04acd..4e26962e 100644
--- a/t/extindex-psgi.t
+++ b/t/extindex-psgi.t
@@ -59,8 +59,14 @@ my $client = sub {
         is($res->code, 200, 'all.mbox.gz');
 
         $res = $cb->(GET('/'));
-        my $html = $res->content;
-        like($html, qr!\Qhttp://bogus.example.com/all\E!, 'html shows /all');
+        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);