[Catalyst-commits] r7024 - Catalyst-Runtime/5.70/trunk/t

ash at dev.catalyst.perl.org ash at dev.catalyst.perl.org
Thu Oct 18 11:51:16 GMT 2007


Author: ash
Date: 2007-10-18 11:51:16 +0100 (Thu, 18 Oct 2007)
New Revision: 7024

Modified:
   Catalyst-Runtime/5.70/trunk/t/live_engine_request_uri.t
Log:
Test to ensure that %2B is escaped to a '+' in the output (SYBER)

Modified: Catalyst-Runtime/5.70/trunk/t/live_engine_request_uri.t
===================================================================
--- Catalyst-Runtime/5.70/trunk/t/live_engine_request_uri.t	2007-10-17 19:10:22 UTC (rev 7023)
+++ Catalyst-Runtime/5.70/trunk/t/live_engine_request_uri.t	2007-10-18 10:51:16 UTC (rev 7024)
@@ -6,7 +6,7 @@
 use FindBin;
 use lib "$FindBin::Bin/lib";
 
-use Test::More tests => 49;
+use Test::More tests => 54;
 use Catalyst::Test 'TestApp';
 use Catalyst::Request;
 
@@ -119,3 +119,13 @@
     ok( $response->is_success, 'Response Successful 2xx' );
     is( $response->header( 'X-Catalyst-warnings' ), 0, 'no warnings emitted' );
 }
+
+
+# test that query params are unescaped properly with '+'
+{
+    ok( my $response = request('http://localhost/engine/request/uri?text=C%2B%2B+lang'), 'Request' );
+    ok( $response->is_success, 'Response Successful 2xx' );
+    ok( eval '$creq = ' . $response->content, 'Unserialize Catalyst::Request' );
+    is( $creq->{uri}->query, 'text=C%2B%2B+lang', 'Query string ok' );
+    is( $creq->{parameters}->{text}, 'C++ lang', 'Unescaped param has pluses in it' );
+}




More information about the Catalyst-commits mailing list