From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=unavailable autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 17B121FCCB for ; Sat, 28 May 2016 01:57:18 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 1/7] t/plack: ensure we can cascade on common endpoints Date: Sat, 28 May 2016 01:57:08 +0000 Message-Id: <20160528015714.1325-2-e@80x24.org> In-Reply-To: <20160528015714.1325-1-e@80x24.org> References: <20160528015714.1325-1-e@80x24.org> List-Id: We don't serve things like robots.txt, favicon.ico, or .well-known/ endpoints ourselves, but ensure we can be used with Plack::App::Cascade for others. --- t/plack.t | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/t/plack.t b/t/plack.t index 04680b2..a4f3245 100644 --- a/t/plack.t +++ b/t/plack.t @@ -62,16 +62,24 @@ EOF require $psgi; }; + test_psgi($app, sub { + my ($cb) = @_; + foreach my $u (qw(robots.txt favicon.ico .well-known/foo)) { + my $res = $cb->(GET("http://example.com/$u")); + is($res->code, 404, "$u is missing"); + } + }); + # redirect with newsgroup test_psgi($app, sub { my ($cb) = @_; my $from = 'http://example.com/inbox.test'; my $to = 'http://example.com/test/'; my $res = $cb->(GET($from)); - is($res->code, 301, 'is permanent redirect'); + is($res->code, 301, 'newsgroup name is permanent redirect'); is($to, $res->header('Location'), 'redirect location matches'); $from .= '/'; - is($res->code, 301, 'is permanent redirect'); + is($res->code, 301, 'newsgroup name/ is permanent redirect'); is($to, $res->header('Location'), 'redirect location matches'); }); -- EW