]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/psgi_search.t
No ext_urls
[public-inbox.git] / t / psgi_search.t
index 3da93eda718cd7335c2b1f747f2a7f16e2bf880e..27946391cfd3030cc4fa6d6356ed7ec4f53cbc95 100644 (file)
@@ -1,5 +1,5 @@
 #!perl -w
-# Copyright (C) 2017-2021 all contributors <meta@public-inbox.org>
+# Copyright (C) all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 use strict;
 use v5.10.1;
@@ -93,6 +93,7 @@ test_psgi(sub { $www->call(@_) }, sub {
 
        $res = $cb->(POST('/test/?q=s:bogus&x=m'));
        is($res->code, 404, 'failed search result gives 404');
+       like($res->content, qr/No results found/, "`No results' shown");
        is_deeply([], $warn, 'no warnings');
 
        my $mid_re = qr/\Q$mid\E/o;
@@ -103,6 +104,11 @@ test_psgi(sub { $www->call(@_) }, sub {
                like($res->content, $mid_re, 'found mid in response');
                chop($digits);
        }
+       $res = $cb->(GET("/test/$mid/"));
+       $html = $res->content;
+       like($html, qr/\bFrom: &#198;var /,
+               "displayed Ævar's name properly in permalink From:");
+       unlike($html, qr/&#195;/, 'no raw octets in permalink HTML');
 
        $res = $cb->(GET('/test/'));
        $html = $res->content;