X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FTestApp%2FController%2FRoot.pm;h=b626bdb0554713e20f20d29b9bf48ce92b7b01ff;hb=9af4ee013b23e7241d4664ea39952fa3b20f4b7f;hp=ce3ee757de9a07f79b8a3ebcc83021356204f89d;hpb=ffb438031c2764e94ffe9e9af68a1b172eac4740;p=catagits%2FCatalyst-Runtime.git diff --git a/t/lib/TestApp/Controller/Root.pm b/t/lib/TestApp/Controller/Root.pm index ce3ee75..b626bdb 100644 --- a/t/lib/TestApp/Controller/Root.pm +++ b/t/lib/TestApp/Controller/Root.pm @@ -2,6 +2,7 @@ package TestApp::Controller::Root; use strict; use warnings; use base 'Catalyst::Controller'; +use utf8; __PACKAGE__->config->{namespace} = ''; @@ -24,13 +25,6 @@ sub emptybody : Local { $c->res->body(''); } -sub localregex : LocalRegex('^localregex$') { - my ( $self, $c ) = @_; - $c->res->header( 'X-Test-Class' => ref($self) ); - $c->response->content_type('text/plain; charset=utf-8'); - $c->forward('TestApp::View::Dump::Request'); -} - sub index : Private { my ( $self, $c ) = @_; $c->res->body('root index'); @@ -56,6 +50,7 @@ sub loop_test : Local { sub recursion_test : Local { my ( $self, $c ) = @_; + no warnings 'recursion'; $c->forward( 'recursion_test' ); } @@ -82,6 +77,35 @@ sub body_semipredicate : Local { $c->res->body('Body'); } + +sub test_redirect :Global { + my ($self, $c) = @_; + # Don't set content_type + # Don't set body + $c->res->redirect('/go_here'); +} + +sub test_redirect_uri_for :Global { + my ($self, $c) = @_; + # Don't set content_type + # Don't set body + $c->res->redirect($c->uri_for('/go_here')); +} + +sub test_redirect_with_contenttype :Global { + my ($self, $c) = @_; + # set content_type but don't set body + $c->res->content_type('image/jpeg'); + $c->res->redirect('/go_here'); +} + +sub test_redirect_with_content :Global { + my ($self, $c) = @_; + $c->res->content_type('text/plain'); + $c->res->body('Please kind sir, I beg you to go to /go_here.'); + $c->res->redirect('/go_here'); +} + sub end : Private { my ($self,$c) = @_; }