use FindBin;
use lib "$FindBin::Bin/../../../lib";
-use Test::More tests => 24;
+use Test::More tests => 30;
use Catalyst::Test 'TestApp';
{
ok( my $response = request('http://localhost/action/forward/with_args/old'), 'Request with args' );
ok( $response->is_success, 'Response Successful 2xx' );
- is( $response->content,'old');
+ is( $response->content, 'old' );
}
{
ok( my $response = request('http://localhost/action/forward/with_method_and_args/old'), 'Request with args and method' );
ok( $response->is_success, 'Response Successful 2xx' );
- is( $response->content,'old');
+ is( $response->content, 'old' );
+}
+
+# test forward with embedded args
+{
+ ok( my $response = request('http://localhost/action/forward/args_embed_relative'), 'Request' );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content, 'ok' );
+
+ ok( my $response = request('http://localhost/action/forward/args_embed_absolute'), 'Request' );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content, 'ok' );
}
die "passed argument does not match args" unless $val eq $c->req->args->[0];
}
+sub args_embed_relative : Local {
+ my ( $self, $c ) = @_;
+ $c->forward( 'embed/ok' );
+}
+
+sub args_embed_absolute : Local {
+ my ( $self, $c ) = @_;
+ $c->forward( '/action/forward/embed/ok' );
+}
+
+sub embed : Local {
+ my ( $self, $c, $ok ) = @_;
+
+ $ok ||= 'not ok';
+ $c->res->body( $ok );
+}
+
1;