Added $upload->slurp and tests
[catagits/Catalyst-Runtime.git] / t / engine / request / uploads.t
index adb43d2..f24b60b 100644 (file)
@@ -6,7 +6,7 @@ use warnings;
 use FindBin;
 use lib "$FindBin::Bin/../../lib";
 
-use Test::More tests => 39;
+use Test::More tests => 43;
 use Catalyst::Test 'TestApp';
 
 use Catalyst::Request;
@@ -99,3 +99,19 @@ use HTTP::Request::Common;
         is( $upload->size, length( $part->content ), 'Upload Content-Length' );
     }
 }
+
+{
+    my $creq;
+
+    my $request = POST( 'http://localhost/engine/request/uploads/slurp',
+        'Content-Type' => 'multipart/form-data',
+        'Content'      => [
+            'slurp' => [ "$FindBin::Bin/uploads.t" ],
+         ]
+    );
+
+    ok( my $response = request($request), 'Request' );
+    ok( $response->is_success, 'Response Successful 2xx' );
+    is( $response->content_type, 'text/plain', 'Response Content-Type' );
+    is( $response->content, ($request->parts)[0]->content, 'Content' );
+}