X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=t%2Faggregate%2Flive_component_controller_attributes.t;h=d991b79ec78178db717ba734f516f2946a4d148f;hp=e8832d943e21438286ce794b40787a1017f97fc5;hb=0b0aee670c39f8cb8f140eb62de9bfaf2c343a24;hpb=d0cacee71a316290bc01f0e12681c16bdc1e84e2 diff --git a/t/aggregate/live_component_controller_attributes.t b/t/aggregate/live_component_controller_attributes.t index e8832d9..d991b79 100644 --- a/t/aggregate/live_component_controller_attributes.t +++ b/t/aggregate/live_component_controller_attributes.t @@ -3,17 +3,44 @@ use strict; use warnings; +use Data::Dumper; +$Data::Dumper::Maxdepth=1; use FindBin; use lib "$FindBin::Bin/../lib"; -use Test::More tests => 4; +use Test::More tests => 13; use Catalyst::Test 'TestApp'; +sub ok_actions { + my ($response, $actions, $msg) = @_; + my $expected = join ", ", + (map { "TestApp::Controller::Attributes->$_" } @$actions), + 'TestApp::Controller::Root->end'; + is( $response->header('x-catalyst-executed') => $expected, + $msg//'Executed correct acitons'); + } + 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_actions($response => ['foo']); + +ok( $response = request('http://localhost/attributes/all_attrs'), + "get /attributes/all_attrs" ); +ok( $response->is_success, "Response OK" ); +ok_actions($response => [qw/fetch all_attrs_action/]); +ok( $response = request('http://localhost/attributes/some_attrs'), + "get /attributes/some_attrs" ); ok( $response->is_success, "Response OK" ); +ok_actions($response => [qw/fetch some_attrs_action/]); + +ok( $response = request('http://localhost/attributes/one_attr'), + "get /attributes/one_attr" ); +ok( $response->is_success, "Response OK" ); +ok_actions($response => [qw/fetch one_attr_action/]); + +