Merged 5.49_01 (r1339) from refactored branch to trunk
[catagits/Catalyst-Runtime.git] / t / live / lib / TestApp.pm
similarity index 60%
rename from t/lib/TestApp.pm
rename to t/live/lib/TestApp.pm
index c4f1649..8227622 100644 (file)
@@ -1,20 +1,15 @@
 package TestApp;
 
 use strict;
-use Catalyst qw[Test::Errors Test::Headers];
+use Catalyst qw/Test::Errors Test::Headers Test::Plugin/;
 use Catalyst::Utils;
 
 our $VERSION = '0.01';
 
-TestApp->config(
-    name => 'TestApp',
-    root => '/Users/chansen/src/MyApp/root',
-);
+TestApp->config( name => 'TestApp', root => '/some/dir' );
 
 TestApp->setup;
 
-#sub execute { return shift->NEXT::execute(@_); } # does not work, bug?
-
 sub global_action : Private {
     my ( $self, $c ) = @_;
     $c->forward('TestApp::View::Dump::Request');
@@ -23,7 +18,7 @@ sub global_action : Private {
 sub execute {
     my $c      = shift;
     my $class  = ref( $c->component( $_[0] ) ) || $_[0];
-    my $action = $c->actions->{reverse}->{"$_[1]"} || "$_[1]";
+    my $action = "$_[1]";
 
     my $method;
 
@@ -36,9 +31,14 @@ sub execute {
 
     if ( $class && $method ) {
         my $executed = sprintf( "%s->%s", $class, $method );
-        $c->response->headers->push_header( 'X-Catalyst-Executed' => $executed );
+        my @executed = $c->response->headers->header('X-Catalyst-Executed');
+        push @executed, $executed;
+        $c->response->headers->header(
+            'X-Catalyst-Executed' => join ', ',
+            @executed
+        );
     }
-    
+
     return $c->SUPER::execute(@_);
 }