7 use lib "$FindBin::Bin/../../../lib";
9 use Test::More tests => 31;
10 use Catalyst::Test 'TestApp';
15 TestApp::Controller::Action::Forward->begin
16 TestApp::Controller::Action::Forward->one
17 TestApp::Controller::Action::Forward->two
18 TestApp::Controller::Action::Forward->three
19 TestApp::Controller::Action::Forward->four
20 TestApp::Controller::Action::Forward->five
21 TestApp::View::Dump::Request->process
24 my $expected = join( ", ", @expected );
26 # Test forward to global private action
27 ok( my $response = request('http://localhost/action/forward/global'), 'Request' );
28 ok( $response->is_success, 'Response Successful 2xx' );
29 is( $response->content_type, 'text/plain', 'Response Content-Type' );
30 is( $response->header('X-Catalyst-Action'), 'action/forward/global', 'Main Class Action' );
31 # Test forward to chain of actions.
32 ok( $response = request('http://localhost/action/forward/one'), 'Request' );
33 ok( $response->is_success, 'Response Successful 2xx' );
34 is( $response->content_type, 'text/plain', 'Response Content-Type' );
35 is( $response->header('X-Catalyst-Action'), 'action/forward/one', 'Test Action' );
36 is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Forward', 'Test Class' );
37 is( $response->header('X-Catalyst-Executed'), $expected, 'Executed actions' );
38 like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' );
43 TestApp::Controller::Action::Forward->begin
44 TestApp::Controller::Action::Forward->six
45 TestApp::View::Dump::False->process
48 my $expected = join( ", ", @expected );
50 ok( my $response = request('http://localhost/action/forward/six'), 'Request' );
51 ok( $response->is_success, 'Response Successful 2xx' );
52 is( $response->content_type, 'text/plain', 'Response Content-Type' );
53 is( $response->header('X-Catalyst-Action'), 'action/forward/six', 'Main Class Action' );
54 is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Forward', 'Test Class' );
55 is( $response->header('X-Catalyst-Executed'), $expected, 'Executed actions' );
56 like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' );
61 TestApp::Controller::Action::Forward->begin
62 TestApp::Controller::Action::Forward->jojo
63 TestApp::Controller::Action::Forward->one
64 TestApp::Controller::Action::Forward->two
65 TestApp::Controller::Action::Forward->three
66 TestApp::Controller::Action::Forward->four
67 TestApp::Controller::Action::Forward->five
68 TestApp::View::Dump::Request->process
69 TestApp::Controller::Action::Forward->three
70 TestApp::Controller::Action::Forward->four
71 TestApp::Controller::Action::Forward->five
72 TestApp::View::Dump::Request->process
75 my $expected = join( ", ", @expected );
77 ok( my $response = request('http://localhost/action/forward/jojo'), 'Request' );
78 ok( $response->is_success, 'Response Successful 2xx' );
79 is( $response->content_type, 'text/plain', 'Response Content-Type' );
80 is( $response->header('X-Catalyst-Action'), 'action/forward/jojo', 'Test Action' );
81 is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Forward', 'Test Class' );
82 is( $response->header('X-Catalyst-Executed'), $expected, 'Executed actions' );
83 like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' );
87 ok( my $response = request('http://localhost/action/forward/with_args/old'), 'Request with args' );
88 ok( $response->is_success, 'Response Successful 2xx' );
89 is( $response->content,'old');
93 ok( my $response = request('http://localhost/action/forward/with_method_and_args/old'), 'Request with args and method' );
94 ok( $response->is_success, 'Response Successful 2xx' );
95 is( $response->content,'old');