added test for chained dispatcher fail on multiple CaptureArgs(0) parts introduced...
[catagits/Catalyst-Runtime.git] / t / lib / TestApp / View / Dump.pm
index db7c2a0..a59e417 100644 (file)
@@ -37,19 +37,23 @@ sub process {
     my $context = delete $reference->{_context};
 
     if ( my $output =
-        $self->dump( $reference || $c->stash->{dump} || $c->stash ) )
+        $self->dump( $reference ) )
     {
 
         $c->res->headers->content_type('text/plain');
         $c->res->output($output);
 
-        # Repair context
-        $reference->{_context} = $context;
-        weaken( $reference->{_context} );
-
-        # Repair body
-        delete $reference->{__body_type};
-        $reference->{_body} = $body;
+        if ($context) {
+            # Repair context
+            $reference->{_context} = $context;
+            weaken( $reference->{_context} );
+        }
+
+        if ($body) {
+            # Repair body
+            delete $reference->{__body_type};
+            $reference->{_body} = $body;
+        }
 
         return 1;
     }