From: Peter Karman Date: Mon, 27 Apr 2009 14:52:27 +0000 (+0000) Subject: add test for attribute overrides X-Git-Tag: 5.80003~26 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=683d672bda70d0e1297bb8e4695df2b370f8b9a3;p=catagits%2FCatalyst-Runtime.git add test for attribute overrides --- diff --git a/t/aggregate/live_component_controller_atttributes.t b/t/aggregate/live_component_controller_atttributes.t new file mode 100644 index 0000000..e8832d9 --- /dev/null +++ b/t/aggregate/live_component_controller_atttributes.t @@ -0,0 +1,19 @@ +#!perl + +use strict; +use warnings; + +use FindBin; +use lib "$FindBin::Bin/../lib"; + +use Test::More tests => 4; +use Catalyst::Test 'TestApp'; + +ok( my $response = request('http://localhost/attributes/view'), + 'get /attributes/view' ); +ok( !$response->is_success, 'Response Unsuccessful' ); + +ok( $response = request('http://localhost/attributes/foo'), + "get /attributes/foo" ); + +ok( $response->is_success, "Response OK" ); diff --git a/t/lib/TestApp/Controller/Attributes.pm b/t/lib/TestApp/Controller/Attributes.pm new file mode 100644 index 0000000..6f8020b --- /dev/null +++ b/t/lib/TestApp/Controller/Attributes.pm @@ -0,0 +1,30 @@ +use strict; +use warnings; + +package My::AttributesBaseClass; +use base qw( Catalyst::Controller ); + +sub fetch : Chained('/') PathPrefix CaptureArgs(1) { + +} + +sub view : PathPart Chained('fetch') Args(0) { + +} + +sub foo { # no attributes + +} + +package TestApp::Controller::Attributes; +use base qw(My::AttributesBaseClass); + +sub view { # override attributes to "hide" url + +} + +sub foo : Local { + +} + +1;