]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/psgi_v2.t
make Plack optional for non-WWW and non-httpd users
[public-inbox.git] / t / psgi_v2.t
index a02b90fbee2ca8a55468fda116d64114b92d5207..2ecd7458e48eee28467194faa01f14161449397e 100644 (file)
@@ -7,11 +7,11 @@ use PublicInbox::TestCommon;
 require_git(2.6);
 use PublicInbox::MIME;
 use PublicInbox::Config;
-use PublicInbox::WWW;
 use PublicInbox::MID qw(mids);
 require_mods(qw(DBD::SQLite Search::Xapian HTTP::Request::Common Plack::Test
                URI::Escape Plack::Builder));
 use_ok($_) for (qw(HTTP::Request::Common Plack::Test));
+use_ok 'PublicInbox::WWW';
 use_ok 'PublicInbox::V2Writable';
 my ($inboxdir, $for_destroy) = tmpdir();
 my $ibx = {
@@ -154,6 +154,16 @@ test_psgi(sub { $www->call(@_) }, sub {
        my @over = ($raw =~ m/\d{4}-\d+-\d+\s+\d+:\d+ +(?:\d+\% )?(.+)$/gm);
        is_deeply(\@over, [ '<a', '` <a', '` <a' ], 'threaded messages show up');
 
+       $res = $cb->(GET('/v2test/?q=m:a-mid@b&x=A'));
+       is($res->code, 200, 'success with Atom search');
+       SKIP: {
+               require_mods(qw(XML::Feed), 2);
+               $raw = $res->content;
+               my $p = XML::Feed->parse(\$raw);
+               is($p->format, "Atom", "parsed atom feed");
+               is(scalar $p->entries, 3, "parsed three entries");
+       };
+
        local $SIG{__WARN__} = 'DEFAULT';
        $res = $cb->(GET('/v2test/a-mid@b/'));
        $raw = $res->content;