lei/store: stop shard workers + cat-file on idle
[public-inbox.git] / t / psgi_multipart_not.t
blobe7c43abf2e059ebe6ef06390323400ee8fa9db0b
1 #!perl -w
2 # Copyright (C) all contributors <meta@public-inbox.org>
3 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
4 use v5.12;
5 use PublicInbox::TestCommon;
6 use PublicInbox::Eml;
7 require_git 2.6;
8 my @mods = qw(DBD::SQLite Xapian HTTP::Request::Common
9               Plack::Test URI::Escape Plack::Builder Plack::Test);
10 require_mods(@mods);
11 use_ok($_) for (qw(HTTP::Request::Common Plack::Test));
12 use_ok 'PublicInbox::WWW';
13 my $ibx = create_inbox 'v2', version => 2, sub {
14         my ($im) = @_;
15         $im->add(PublicInbox::Eml->new(<<'EOF')) or BAIL_OUT;
16 Message-Id: <200308111450.h7BEoOu20077@mail.osdl.org>
17 To: linux-kernel@vger.kernel.org
18 Subject: [OSDL] linux-2.6.0-test3 reaim results
19 Mime-Version: 1.0
20 Content-Type: multipart/mixed ;
21         boundary="==_Exmh_120757360"
22 Date: Mon, 11 Aug 2003 07:50:24 -0700
23 From: exmh user <x@example.com>
25 Freed^Wmultipart ain't what it used to be
26 EOF
29 my $tmpdir = tmpdir;
30 my $www = PublicInbox::WWW->new(cfg_new($tmpdir, <<EOF));
31 [publicinbox "v2test"]
32         address = $ibx->{-primary_address}
33         inboxdir = $ibx->{inboxdir}
34 EOF
35 my ($res, $raw);
36 test_psgi(sub { $www->call(@_) }, sub {
37         my ($cb) = @_;
38         for my $u ('/v2test/?q=%22ain\'t what it used to be%22&x=t',
39                    '/v2test/new.atom', '/v2test/new.html') {
40                 $res = $cb->(GET($u));
41                 $raw = $res->content;
42                 ok(index($raw, 'Freed^Wmultipart') >= 0, $u);
43                 ok(index($raw, 'Warning: decoded text') >= 0, $u.' warns');
44         }
45 });
46 done_testing;