[Catalyst-commits] r13862 - in Catalyst-Action-RenderView/trunk/t: . lib/TestApp/Controller

t0m at dev.catalyst.perl.org t0m at dev.catalyst.perl.org
Thu Dec 16 22:08:53 GMT 2010


Author: t0m
Date: 2010-12-16 22:08:53 +0000 (Thu, 16 Dec 2010)
New Revision: 13862

Modified:
   Catalyst-Action-RenderView/trunk/t/04live.t
   Catalyst-Action-RenderView/trunk/t/lib/TestApp/Controller/Root.pm
Log:
Failing test

Modified: Catalyst-Action-RenderView/trunk/t/04live.t
===================================================================
--- Catalyst-Action-RenderView/trunk/t/04live.t	2010-12-16 21:38:13 UTC (rev 13861)
+++ Catalyst-Action-RenderView/trunk/t/04live.t	2010-12-16 22:08:53 UTC (rev 13862)
@@ -62,12 +62,26 @@
         my $request  =
           HTTP::Request->new( GET => 'http://localhost:3000/test_skipview' );
 
-        ok( my $response = request($request), 'Request' );
-        ok( $response->is_success, 'Response Successful 2xx' );
-        is( $response->header( 'Content-Type' ), 'text/html; charset=utf-8', 'Content Type' );
-        is( $response->code, 200, 'Response Code' );
+          ok( my $response = request($request), 'Request' );
+          ok( $response->is_success, 'Response Successful 2xx' );
+          is( $response->header( 'Content-Type' ), 'text/html; charset=utf-8', 'Content Type' );
+          is( $response->code, 200, 'Response Code' );
 
-        is( $response->content, $expected, 'Content OK' );
+          is( $response->content, $expected, 'Content OK' );
     }
 
+    # test X-Sendfile case
+    {
+        my $request  =
+          HTTP::Request->new( GET => 'http://localhost:3000/test_definedbody_skipsview' );
+
+      ok( my $response = request($request), 'Request' );
+      ok( $response->is_success, 'Response Successful 2xx' );
+      is( $response->header( 'Content-Type' ), 'text/html; charset=utf-8', 'Content Type' );
+      is( $response->code, 200, 'Response Code' );
+
+      is( $response->content, '', 'Content OK' );
+      is( $response->header('X-Sendfile'), '/some/file/path', 'X-Sendfile header present' );
+    }
+
 }

Modified: Catalyst-Action-RenderView/trunk/t/lib/TestApp/Controller/Root.pm
===================================================================
--- Catalyst-Action-RenderView/trunk/t/lib/TestApp/Controller/Root.pm	2010-12-16 21:38:13 UTC (rev 13861)
+++ Catalyst-Action-RenderView/trunk/t/lib/TestApp/Controller/Root.pm	2010-12-16 22:08:53 UTC (rev 13862)
@@ -23,6 +23,12 @@
     $c->res->body( 'Skipped View' );
 }
 
+sub test_definedbody_skipsview : Global {
+    my( $self, $c ) = @_;
+    $c->res->header('X-Sendfile', '/some/file/path'); # This is the use-case
+    $c->res->body( '' );
+}
+
 sub end : ActionClass('RenderView') {}
 
 1;




More information about the Catalyst-commits mailing list