merged conflicts
[catagits/Catalyst-Runtime.git] / t / aggregate / live_component_controller_attributes.t
1 use strict;
2 use warnings;
3
4 use Data::Dumper;
5 $Data::Dumper::Maxdepth=1;
6 use FindBin;
7 use lib "$FindBin::Bin/../lib";
8
9 use Test::More tests => 13;
10 use Catalyst::Test 'TestApp';
11
12 sub ok_actions {
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');
19     }
20
21 ok( my $response = request('http://localhost/attributes/view'),
22     'get /attributes/view' );
23 ok( !$response->is_success, 'Response Unsuccessful' );
24
25 ok( $response = request('http://localhost/attributes/foo'),
26     "get /attributes/foo" );
27 ok_actions($response => ['foo']);
28
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/]);
33
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/]);
38
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/]);
43
44