X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=blobdiff_plain;f=t%2Fpsgi_search.t;h=56b421189bf42c0b19391269607de1e68e98a0a4;hp=5310e5aba9553bbabf252da82c97d3a520c9165e;hb=3dff4a5399f10cbcb3d902da094680705c50193a;hpb=8122bd3803b7520ab5421df264406e670e3f902b diff --git a/t/psgi_search.t b/t/psgi_search.t index 5310e5ab..56b42118 100644 --- a/t/psgi_search.t +++ b/t/psgi_search.t @@ -27,16 +27,32 @@ my $im = $ibx->importer(0); my $digits = '10010260936330'; my $ua = 'Pine.LNX.4.10'; my $mid = "$ua.$digits.2460-100000\@penguin.transmeta.com"; -my $data = <<"EOF"; +my $mime = PublicInbox::MIME->new(< From: Ævar Arnfjörð Bjarmason To: git\@vger.kernel.org EOF +$im->add($mime); + +$mime = PublicInbox::MIME->new(<<'EOF'); +Subject: +Message-ID: +From: blank subject +To: git@vger.kernel.org + +EOF +$im->add($mime); -my $mime = Email::MIME->new(\$data); +$mime = PublicInbox::MIME->new(<<'EOF'); +Message-ID: +From: no subject at all +To: git@vger.kernel.org + +EOF $im->add($mime); + $im->done; PublicInbox::SearchIdx->new($ibx, 1)->index_sync; @@ -78,6 +94,19 @@ test_psgi(sub { $www->call(@_) }, sub { like($res->content, $mid_re, 'found mid in response'); chop($digits); } + + $res = $cb->(GET('/test/')); + $html = $res->content; + like($html, qr/\bhref="no-subject-at-all[^>]+>\(no subject\)]+>\(no subject\)(GET('/test/?q=tc:git')); + like($html, qr/\bhref="no-subject-at-all[^>]+>\(no subject\)]+>\(no subject\)