]> Sergey Matveev's repositories - public-inbox.git/commitdiff
t/plack: ensure we can cascade on common endpoints
authorEric Wong <e@80x24.org>
Sat, 28 May 2016 01:57:08 +0000 (01:57 +0000)
committerEric Wong <e@80x24.org>
Sat, 28 May 2016 01:57:34 +0000 (01:57 +0000)
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

index 04680b2a61b5e6301e89a3c20b9ee93dafd435d3..a4f324571ac12fe3e739b3f788a5a33b9de74f0c 100644 (file)
--- 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');
        });