Sort out CatalystX::CRUD issues
Tomas Doran [Mon, 12 Jan 2009 04:46:50 +0000 (04:46 +0000)]
Changes
TODO
lib/Catalyst/Test.pm
t/unit_load_catalyst_test.t

diff --git a/Changes b/Changes
index 647cda5..45bc367 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,6 +1,10 @@
 # This file documents the revision history for Perl extension Catalyst.
 
 5.8000_05
+        - Passing request method exported by Catalyst::Test an extra
+          parameter used to be ignored, but started breaking if the parameter
+          was not a hash in 5.8000_04. Extra parameter is now ignored if
+          it isn't a hashref (t0m)
         - Fix request argumentss getting corrupted if you override the 
           dispatcher and call an action which detaches (for 
           Catalyst::Plugin::Authorization::ACL) (t0m)
diff --git a/TODO b/TODO
index 6386cb2..ca33efc 100644 (file)
--- a/TODO
+++ b/TODO
@@ -10,13 +10,11 @@ Known issues:
        and which not, like NEXT does. Log::Log4perl needs to be fixed and the
        problem should be described in Upgrading.pod. (rafl)
 
-     - CatalystX-CRUD-ModelAdapter-DBIC
-       fail tests against 5.80 (karpet)
-
      - Waiting on new releases:
        - Catalyst::Plugin::Authentication - 0.100092
        - Catalyst::Action::RenderView     - 0.08
        - Catalyst::Plugin::DebugCookie    - 0.999002
+       - CatalystX::CRUD                  - 0.38
 
 Documentation:
 
index dcd839a..65c4354 100644 (file)
@@ -255,6 +255,7 @@ sub remote_request {
 sub _customize_request {
     my $request = shift;
     my $opts = pop(@_) || {};
+    $opts = {} unless ref($opts) eq 'HASH';
     if ( my $host = exists $opts->{host} ? $opts->{host} : $default_host  ) {
         $request->header( 'Host' => $host );
     }
index 1b4d863..67a1171 100644 (file)
@@ -7,8 +7,9 @@ use Test::More;
 use FindBin qw/$Bin/;
 use lib "$Bin/lib";
 use Catalyst::Utils;
+use HTTP::Request::Common;
 
-plan tests => 9;
+plan tests => 11;
 
 use_ok('Catalyst::Test');
 
@@ -18,6 +19,8 @@ isnt( $@, "", "get returns an error message with no app specified");
 eval "request('http://localhost')";
 isnt( $@, "", "request returns an error message with no app specified");
 
+# FIXME - These vhosts in tests tests should be somewhere else...
+
 sub customize { Catalyst::Test::_customize_request(@_) }
 
 {
@@ -55,3 +58,11 @@ sub customize { Catalyst::Test::_customize_request(@_) }
 
 # Back compat test, extra args used to be ignored, now a hashref of options.
 use_ok('Catalyst::Test', 'TestApp', 'foobar');
+
+# Back compat test, ensure that request ignores anything which isn't a hash.
+lives_ok {
+    request(GET('/dummy'), 'foo');
+} 'scalar additional param to request method ignored';
+lives_ok {
+    request(GET('/dummy'), []);
+} 'array additional param to request method ignored';