[Catalyst-commits] r10291 - in Catalyst-Runtime/5.80/trunk/t: aggregate lib/TestApp/Controller/Action

caelum at dev.catalyst.perl.org caelum at dev.catalyst.perl.org
Tue May 26 15:02:55 GMT 2009


Author: caelum
Date: 2009-05-26 15:02:53 +0000 (Tue, 26 May 2009)
New Revision: 10291

Modified:
   Catalyst-Runtime/5.80/trunk/t/aggregate/live_component_controller_action_chained.t
   Catalyst-Runtime/5.80/trunk/t/aggregate/live_component_controller_action_local.t
   Catalyst-Runtime/5.80/trunk/t/lib/TestApp/Controller/Action/Chained.pm
   Catalyst-Runtime/5.80/trunk/t/lib/TestApp/Controller/Action/Local.pm
Log:
add tests which prove the current behavior of not decoding chained args but decoding local args

Modified: Catalyst-Runtime/5.80/trunk/t/aggregate/live_component_controller_action_chained.t
===================================================================
--- Catalyst-Runtime/5.80/trunk/t/aggregate/live_component_controller_action_chained.t	2009-05-26 03:19:38 UTC (rev 10290)
+++ Catalyst-Runtime/5.80/trunk/t/aggregate/live_component_controller_action_chained.t	2009-05-26 15:02:53 UTC (rev 10291)
@@ -10,7 +10,7 @@
 
 BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
 
-use Test::More tests => 143*$iters;
+use Test::More tests => 145*$iters;
 use Catalyst::Test 'TestApp';
 
 if ( $ENV{CAT_BENCHMARK} ) {
@@ -1004,4 +1004,12 @@
                 $expected, 'Executed actions' );
         }
     }
+
+    {
+        ok( my $content =
+            get('http://localhost/chained/return_arg/foo%2Fbar%3B'),
+            'request with URI-encoded arg' );
+        # this is the CURRENT behavior
+        like( $content, qr{foo%2Fbar%3B\z}, 'args NOT decoded' );
+    }
 }

Modified: Catalyst-Runtime/5.80/trunk/t/aggregate/live_component_controller_action_local.t
===================================================================
--- Catalyst-Runtime/5.80/trunk/t/aggregate/live_component_controller_action_local.t	2009-05-26 03:19:38 UTC (rev 10290)
+++ Catalyst-Runtime/5.80/trunk/t/aggregate/live_component_controller_action_local.t	2009-05-26 15:02:53 UTC (rev 10291)
@@ -10,7 +10,7 @@
 
 BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
 
-use Test::More tests => 32*$iters;
+use Test::More tests => 34*$iters;
 use Catalyst::Test 'TestApp';
 
 if ( $ENV{CAT_BENCHMARK} ) {
@@ -135,4 +135,11 @@
             "Parameters don't split on %2F"
         );
     }
+
+    {
+        ok( my $content = get('http://locahost/action/local/five/foo%2Fbar%3B'),
+            'request with URI-encoded arg');
+        # this is the CURRENT behavior
+        like( $content, qr{'foo/bar;'}, 'args for Local actions URI-decoded' );
+    }
 }

Modified: Catalyst-Runtime/5.80/trunk/t/lib/TestApp/Controller/Action/Chained.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/t/lib/TestApp/Controller/Action/Chained.pm	2009-05-26 03:19:38 UTC (rev 10290)
+++ Catalyst-Runtime/5.80/trunk/t/lib/TestApp/Controller/Action/Chained.pm	2009-05-26 15:02:53 UTC (rev 10291)
@@ -195,6 +195,8 @@
 sub star_search : Chained('view') PathPart('search') Args(0) { }
 sub doc_star : Chained('/') PathPart('chained/doc') Args(1) {}
 
+sub return_arg : Chained('/') PathPart('chained/return_arg') Args(1) {}
+
 sub end :Private {
   my ($self, $c) = @_;
   return if $c->stash->{no_end};

Modified: Catalyst-Runtime/5.80/trunk/t/lib/TestApp/Controller/Action/Local.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/t/lib/TestApp/Controller/Action/Local.pm	2009-05-26 03:19:38 UTC (rev 10290)
+++ Catalyst-Runtime/5.80/trunk/t/lib/TestApp/Controller/Action/Local.pm	2009-05-26 15:02:53 UTC (rev 10291)
@@ -23,4 +23,9 @@
     $c->forward('TestApp::View::Dump::Request');
 }
 
+sub five : Action Local Args(1) {
+    my ( $self, $c ) = @_;
+    $c->forward('TestApp::View::Dump::Request');
+}
+
 1;




More information about the Catalyst-commits mailing list