X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Faggregate%2Flive_component_controller_action_action.t;h=bc2038ebc8039886276b0f05b532757bcd2e0369;hb=d9d41c5af176289832bdb455ec18d3436cf69330;hp=8dda2031c88e6e1571b21175ac84c646a8fe6ca7;hpb=d87210ecba82597fafd26a7da8c8e1bf66d2c5ec;p=catagits%2FCatalyst-Runtime.git diff --git a/t/aggregate/live_component_controller_action_action.t b/t/aggregate/live_component_controller_action_action.t index 8dda203..bc2038e 100644 --- a/t/aggregate/live_component_controller_action_action.t +++ b/t/aggregate/live_component_controller_action_action.t @@ -166,6 +166,33 @@ sub run_tests { 'Content is a serialized Catalyst::Request' ); } + + { + ok( my $response = request('http://localhost/action_action_eight'), + 'Request' ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + is( $response->header('X-Catalyst-Action'), + 'action_action_eight', 'Test Action' ); + is( + $response->header('X-Test-Class'), + 'TestApp::Controller::Action::Action', + 'Test Class' + ); + like( + $response->content, + qr/^bless\( .* 'Catalyst::Action' \)$/s, + 'Content is a serialized Catalyst::Action' + ); + + require Catalyst::Action; # when running against a remote server, we + # need to load the class in the test process + # to be able to introspect the action instance + # later. + my $action = eval $response->content; + is_deeply $action->attributes->{extra_attribute}, [13]; + is_deeply $action->attributes->{another_extra_attribute}, ['foo']; + } } done_testing;