TWMC: Fix bug where redirect was followed on a 500 response
[catagits/Test-WWW-Mechanize-Catalyst.git] / t / lib / Catty.pm
index c67429a..83e6745 100644 (file)
@@ -1,6 +1,7 @@
 package Catty;
 
 use strict;
+use warnings;
 
 #use Catalyst;
 use Catalyst;
@@ -76,6 +77,13 @@ sub check_auth_basic : Global {
     }
 }
 
+sub redirect_with_500 : Global {
+    my ( $self, $c ) = @_;
+    $DB::single = 1;
+    $c->res->redirect( $c->uri_for("/bonjour"));
+    die "erk!";
+}
+
 sub die : Global {
     my ( $self, $context ) = @_;
     my $html = html( "Die", "This is the die page" );