diff options
author | Eric Wong <e@80x24.org> | 2021-08-27 12:08:45 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-08-28 10:37:10 +0000 |
commit | 733a7405f5a9d24782093876f178c6eb954dc17c (patch) | |
tree | 090a959b059f486f28dc78ac3b471a9d2ece6ed7 /t | |
parent | c08ecad116d24f642bb53634eb6243a54e3a20be (diff) | |
download | public-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')
-rw-r--r-- | t/extindex-psgi.t | 10 |
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); |