Unfuck last commit, fix go tests, remove unneeded crud from TestApp, add FIXME for...
Tomas Doran [Sat, 21 Mar 2009 18:11:04 +0000 (18:11 +0000)]
lib/Catalyst/Dispatcher.pm
t/aggregate/live_component_controller_action_go.t
t/lib/TestApp.pm
t/lib/TestApp/Controller/Action/Go.pm

index 68fe551..2786b2e 100644 (file)
@@ -318,8 +318,11 @@ sub _find_component_class {
 sub _invoke_as_component {
     my ( $self, $c, $component, $method ) = @_;
 
+    #FIXME - Is this resolving needed/should it just return the instance
+    #        directly
     my $class = $self->_find_component_class( $c, $component ) || return 0;
 
+    my $component_instance = $c->component($class);
     if (my $code = $component_instance->can('action_for')) {
         my $possible_action = $component_instance->$code($method);
         return $possible_action if $possible_action;
index 4ad6c26..9966a94 100644 (file)
@@ -242,7 +242,7 @@ sub run_tests {
         );
         ok( !$response->is_success, 'Response Fails' );
         is( $response->content,
-            q(FATAL ERROR: Couldn't go("TestApp"): Action has no namespace: cannot go() to a plain method or component, must be a :Action or some sort.),
+            q(FATAL ERROR: Couldn't go("TestApp"): Action has no namespace: cannot go() to a plain method or component, must be an :Action of some sort.),
             'Error message'
         );
     }
index 058084f..e0a6385 100644 (file)
@@ -73,16 +73,6 @@ sub class_forward_test_method :Private {
     $c->response->headers->header( 'X-Class-Forward-Test-Method' => 1 );
 }
 
-sub class_go_test_method :Private {
-    my ( $self, $c ) = @_;
-    $c->response->headers->header( 'X-Class-Go-Test-Method' => 1 );
-}
-
-sub class_visit_test_method :Private {
-    my ( $self, $c ) = @_;
-    $c->response->headers->header( 'X-Class-Visit-Test-Method' => 1 );
-}
-
 sub loop_test : Local {
     my ( $self, $c ) = @_;
 
index 23ea06a..cecb8e8 100644 (file)
@@ -96,7 +96,7 @@ sub embed : Local {
 
 sub class_go_test_action : Local {
     my ( $self, $c ) = @_;
-    $c->go(qw/TestApp class_go_test_method/);
+    $c->go(qw/TestApp/);
 }
 
 1;