5 $Data::Dumper::Maxdepth=1;
7 use lib "$FindBin::Bin/../lib";
9 use Test::More tests => 13;
10 use Catalyst::Test 'TestApp';
13 my ($response, $actions, $msg) = @_;
14 my $expected = join ", ",
15 (map { "TestApp::Controller::Attributes->$_" } @$actions),
16 'TestApp::Controller::Root->end';
17 is( $response->header('x-catalyst-executed') => $expected,
18 $msg || 'Executed correct acitons');
21 ok( my $response = request('http://localhost/attributes/view'),
22 'get /attributes/view' );
23 ok( !$response->is_success, 'Response Unsuccessful' );
25 ok( $response = request('http://localhost/attributes/foo'),
26 "get /attributes/foo" );
27 ok_actions($response => ['foo']);
29 ok( $response = request('http://localhost/attributes/all_attrs'),
30 "get /attributes/all_attrs" );
31 ok( $response->is_success, "Response OK" );
32 ok_actions($response => [qw/fetch all_attrs_action/]);
34 ok( $response = request('http://localhost/attributes/some_attrs'),
35 "get /attributes/some_attrs" );
36 ok( $response->is_success, "Response OK" );
37 ok_actions($response => [qw/fetch some_attrs_action/]);
39 ok( $response = request('http://localhost/attributes/one_attr'),
40 "get /attributes/one_attr" );
41 ok( $response->is_success, "Response OK" );
42 ok_actions($response => [qw/fetch one_attr_action/]);