my $expected = join( ", ", @expected );
# Test forward to global private action
- ok( my $response = request('http://localhost/main_action'), 'Request' );
+ ok( my $response = request('http://localhost/action/forward/global'), 'Request' );
ok( $response->is_success, 'Response Successful 2xx' );
is( $response->content_type, 'text/plain', 'Response Content-Type' );
- is( $response->header('X-Catalyst-Action'), 'main_action', 'Main Class Action' );
+ is( $response->header('X-Catalyst-Action'), 'action/forward/global', 'Main Class Action' );
# Test forward to chain of actions.
ok( $response = request('http://localhost/action/forward/one'), 'Request' );
ok( $response->is_success, 'Response Successful 2xx' );
{
- ok( my $response = request('http://localhost/action_absolute_one'), 'Request' );
+ ok( my $response = request('http://localhost/action_global_one'), 'Request' );
ok( $response->is_success, 'Response Successful 2xx' );
is( $response->content_type, 'text/plain', 'Response Content-Type' );
- is( $response->header('X-Catalyst-Action'), 'action_absolute_one', 'Test Action' );
- is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Absolute', 'Test Class' );
+ is( $response->header('X-Catalyst-Action'), 'action_global_one', 'Test Action' );
+ is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Global', 'Test Class' );
like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' );
}
{
- ok( my $response = request('http://localhost/action_absolute_two'), 'Request' );
+ ok( my $response = request('http://localhost/action_global_two'), 'Request' );
ok( $response->is_success, 'Response Successful 2xx' );
is( $response->content_type, 'text/plain', 'Response Content-Type' );
- is( $response->header('X-Catalyst-Action'), 'action_absolute_two', 'Test Action' );
- is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Absolute', 'Test Class' );
+ is( $response->header('X-Catalyst-Action'), 'action_global_two', 'Test Action' );
+ is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Global', 'Test Class' );
like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' );
}
{
- ok( my $response = request('http://localhost/action_absolute_three'), 'Request' );
+ ok( my $response = request('http://localhost/action_global_three'), 'Request' );
ok( $response->is_success, 'Response Successful 2xx' );
is( $response->content_type, 'text/plain', 'Response Content-Type' );
- is( $response->header('X-Catalyst-Action'), 'action_absolute_three', 'Test Action' );
- is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Absolute', 'Test Class' );
+ is( $response->header('X-Catalyst-Action'), 'action_global_three', 'Test Action' );
+ is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Global', 'Test Class' );
like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' );
}
{
- ok( my $response = request('http://localhost/action/relative/one'), 'Request' );
+ ok( my $response = request('http://localhost/action/local/one'), 'Request' );
ok( $response->is_success, 'Response Successful 2xx' );
is( $response->content_type, 'text/plain', 'Response Content-Type' );
- is( $response->header('X-Catalyst-Action'), 'action/relative/one', 'Test Action' );
- is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Relative', 'Test Class' );
+ is( $response->header('X-Catalyst-Action'), 'action/local/one', 'Test Action' );
+ is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Local', 'Test Class' );
like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' );
}
{
- ok( my $response = request('http://localhost/action/relative/two'), 'Request' );
+ ok( my $response = request('http://localhost/action/local/two'), 'Request' );
ok( $response->is_success, 'Response Successful 2xx' );
is( $response->content_type, 'text/plain', 'Response Content-Type' );
- is( $response->header('X-Catalyst-Action'), 'action/relative/two', 'Test Action' );
- is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Relative', 'Test Class' );
+ is( $response->header('X-Catalyst-Action'), 'action/local/two', 'Test Action' );
+ is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Local', 'Test Class' );
like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' );
}
{
- ok( my $response = request('http://localhost/action/relative/three'), 'Request' );
+ ok( my $response = request('http://localhost/action/local/three'), 'Request' );
ok( $response->is_success, 'Response Successful 2xx' );
is( $response->content_type, 'text/plain', 'Response Content-Type' );
- is( $response->header('X-Catalyst-Action'), 'action/relative/three', 'Test Action' );
- is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Relative', 'Test Class' );
+ is( $response->header('X-Catalyst-Action'), 'action/local/three', 'Test Action' );
+ is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Local', 'Test Class' );
like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' );
}
{
- ok( my $response = request('http://localhost/action/relative/four/five/six'), 'Request' );
+ ok( my $response = request('http://localhost/action/local/four/five/six'), 'Request' );
ok( $response->is_success, 'Response Successful 2xx' );
is( $response->content_type, 'text/plain', 'Response Content-Type' );
- is( $response->header('X-Catalyst-Action'), 'action/relative/four/five/six', 'Test Action' );
- is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Relative', 'Test Class' );
+ is( $response->header('X-Catalyst-Action'), 'action/local/four/five/six', 'Test Action' );
+ is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Local', 'Test Class' );
like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' );
}
#sub execute { return shift->NEXT::execute(@_); } # does not work, bug?
-sub main_action : Private {
+sub global_action : Private {
my ( $self, $c ) = @_;
$c->forward('TestApp::View::Dump::Request');
}
$c->forward('five');
}
+sub global : Relative {
+ my ( $self, $c ) = @_;
+ $c->forward('/global_action');
+}
+
+
1;
-package TestApp::Controller::Action::Absolute;
+package TestApp::Controller::Action::Global;
use strict;
use base 'TestApp::Controller::Action';
-sub action_absolute_one : Action Absolute {
+sub action_global_one : Action Absolute {
my ( $self, $c ) = @_;
$c->forward('TestApp::View::Dump::Request');
}
-sub action_absolute_two : Action Global {
+sub action_global_two : Action Global {
my ( $self, $c ) = @_;
$c->forward('TestApp::View::Dump::Request');
}
-sub action_absolute_three : Action Path('/action_absolute_three') {
+sub action_global_three : Action Path('/action_global_three') {
my ( $self, $c ) = @_;
$c->forward('TestApp::View::Dump::Request');
}
-package TestApp::Controller::Action::Relative;
+package TestApp::Controller::Action::Local;
use strict;
use base 'TestApp::Controller::Action';