From: Wallace Reis Date: Thu, 9 Dec 2010 11:54:00 +0000 (+0000) Subject: No need of a second View in tests X-Git-Tag: 0.10~1^2~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-View-Component-SubInclude.git;a=commitdiff_plain;h=48509210d9f173bf1943b826dcffdcc413af5f26 No need of a second View in tests --- diff --git a/t/lib/ESITest/Controller/Root.pm b/t/lib/ESITest/Controller/Root.pm index 43881bf..79a20c3 100644 --- a/t/lib/ESITest/Controller/Root.pm +++ b/t/lib/ESITest/Controller/Root.pm @@ -6,12 +6,6 @@ use base 'Catalyst::Controller'; __PACKAGE__->config->{namespace} = ''; -sub auto : Private { - my ( $self, $c ) = @_; - $c->stash->{'current_view'} = 'TT'; - return 1; -} - sub index :Path Args(0) {} sub base : Chained('/') PathPart('') CaptureArgs(0) {} @@ -108,13 +102,9 @@ sub time_args_no_chained : Path('time_args_no_chained') Args { $c->stash->{template} = 'time_include.tt'; } -sub http : Chained('base') PathPart('') CaptureArgs(0) { - pop->stash->{'current_view'} = 'TTWithHTTP'; -} - -sub http_cpan : Chained('http') Args(0) {} +sub http_cpan : Chained('base') Args(0) {} -sub http_github : Chained('http') Args(0) {} +sub http_github : Chained('base') Args(0) {} sub end : ActionClass('RenderView') {} diff --git a/t/lib/ESITest/View/TT.pm b/t/lib/ESITest/View/TT.pm index 4f17bd6..bf9d33c 100644 --- a/t/lib/ESITest/View/TT.pm +++ b/t/lib/ESITest/View/TT.pm @@ -7,6 +7,16 @@ with 'Catalyst::View::Component::SubInclude'; __PACKAGE__->config( TEMPLATE_EXTENSION => '.tt', subinclude_plugin => 'Visit', + subinclude => { + 'HTTP::GET' => { + class => 'HTTP', + http_method => 'GET', + uri_map => { + '/cpan/' => 'http://search.cpan.org/~', + '/github/' => 'http://github.com/', + }, + }, + }, ); 1; diff --git a/t/lib/ESITest/View/TTWithHTTP.pm b/t/lib/ESITest/View/TTWithHTTP.pm deleted file mode 100644 index 17f9b2f..0000000 --- a/t/lib/ESITest/View/TTWithHTTP.pm +++ /dev/null @@ -1,22 +0,0 @@ -package ESITest::View::TTWithHTTP; -use Moose; - -extends 'Catalyst::View::TT'; -with 'Catalyst::View::Component::SubInclude'; - -__PACKAGE__->config( - TEMPLATE_EXTENSION => '.tt', - subinclude_plugin => 'HTTP::GET', - subinclude => { - 'HTTP::GET' => { - class => 'HTTP', - http_method => 'GET', - uri_map => { - '/cpan/' => 'http://search.cpan.org/~', - '/github/' => 'http://github.com/', - }, - }, - }, -); - -1; diff --git a/t/lib/ESITest/root/http_cpan.tt b/t/lib/ESITest/root/http_cpan.tt index 2e07f3b..4ec56ed 100644 --- a/t/lib/ESITest/root/http_cpan.tt +++ b/t/lib/ESITest/root/http_cpan.tt @@ -1 +1 @@ -[% subinclude('/cpan/wreis') %] +[% subinclude_using('HTTP::GET', '/cpan/wreis') %] diff --git a/t/lib/ESITest/root/http_github.tt b/t/lib/ESITest/root/http_github.tt index 5a127ba..1627c51 100644 --- a/t/lib/ESITest/root/http_github.tt +++ b/t/lib/ESITest/root/http_github.tt @@ -1 +1 @@ -[% subinclude('/github/wreis') %] +[% subinclude_using('HTTP::GET', '/github/wreis') %]