Much cleaner. The visit class test wasn't actually testing visiting the class, so...
[catagits/Catalyst-Runtime.git] / t / lib / TestApp / Controller / Action / Visit.pm
index 0447d34..0ddaacb 100644 (file)
@@ -61,10 +61,11 @@ sub visit_die : Local {
 }
 
 sub visit_chained : Local {
-    my ( $self, $c, $val ) = @_;
-      $val eq 1 ? $c->visit( '/action/chained/foo/spoon',                                 [$val] )
-    : $val eq 2 ? $c->visit( qw/ Action::Chained::Foo spoon /,                            [$val] )
-    :             $c->visit( $c->controller('Action::Chained::Foo')->action_for('spoon'), [$val] )
+    my ( $self, $c, $val, $capture, @args ) = @_;
+    my @cap_and_args = ([$capture], [@args]);
+      $val eq 1 ? $c->visit( '/action/chained/foo/spoon',                                 @cap_and_args)
+    : $val eq 2 ? $c->visit( qw/ Action::Chained::Foo spoon /,                            @cap_and_args)
+    :             $c->visit( $c->controller('Action::Chained::Foo')->action_for('spoon'), @cap_and_args)
 }
 
 sub view : Local {
@@ -97,7 +98,7 @@ sub embed : Local {
 
 sub class_visit_test_action : Local {
     my ( $self, $c ) = @_;
-    $c->visit(qw/TestApp class_visit_test_method/);
+    $c->visit(qw/TestApp/);
 }
 
 1;