merged conflicts
[catagits/Catalyst-Runtime.git] / t / aggregate / live_component_controller_attributes.t
CommitLineData
683d672b 1use strict;
2use warnings;
3
0b0aee67 4use Data::Dumper;
5$Data::Dumper::Maxdepth=1;
683d672b 6use FindBin;
7use lib "$FindBin::Bin/../lib";
8
0b0aee67 9use Test::More tests => 13;
683d672b 10use Catalyst::Test 'TestApp';
11
0b0aee67 12sub 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,
2fe6ed83 18 $msg || 'Executed correct acitons');
0b0aee67 19 }
20
683d672b 21ok( my $response = request('http://localhost/attributes/view'),
22 'get /attributes/view' );
23ok( !$response->is_success, 'Response Unsuccessful' );
24
25ok( $response = request('http://localhost/attributes/foo'),
26 "get /attributes/foo" );
0b0aee67 27ok_actions($response => ['foo']);
28
29ok( $response = request('http://localhost/attributes/all_attrs'),
30 "get /attributes/all_attrs" );
31ok( $response->is_success, "Response OK" );
32ok_actions($response => [qw/fetch all_attrs_action/]);
683d672b 33
0b0aee67 34ok( $response = request('http://localhost/attributes/some_attrs'),
35 "get /attributes/some_attrs" );
683d672b 36ok( $response->is_success, "Response OK" );
0b0aee67 37ok_actions($response => [qw/fetch some_attrs_action/]);
38
39ok( $response = request('http://localhost/attributes/one_attr'),
40 "get /attributes/one_attr" );
41ok( $response->is_success, "Response OK" );
42ok_actions($response => [qw/fetch one_attr_action/]);
43
44