7 use lib "$FindBin::Bin/../../../lib";
\r
9 use Test::More tests => 18;
\r
10 use Catalyst::Test 'TestApp';
\r
15 TestApp::Controller::Action::Detach->begin
\r
16 TestApp::Controller::Action::Detach->one
\r
17 TestApp::Controller::Action::Detach->two
\r
18 TestApp::View::Dump::Request->process
\r
21 my $expected = join( ", ", @expected );
\r
23 # Test detach to chain of actions.
\r
24 ok( my $response = request('http://localhost/action/detach/one'), 'Request' );
\r
25 ok( $response->is_success, 'Response Successful 2xx' );
\r
26 is( $response->content_type, 'text/plain', 'Response Content-Type' );
\r
27 is( $response->header('X-Catalyst-Action'), 'action/detach/one', 'Test Action' );
\r
28 is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Detach', 'Test Class' );
\r
29 is( $response->header('X-Catalyst-Executed'), $expected, 'Executed actions' );
\r
34 TestApp::Controller::Action::Detach->begin
\r
35 TestApp::Controller::Action::Detach->path
\r
36 TestApp::Controller::Action::Detach->two
\r
37 TestApp::View::Dump::Request->process
\r
40 my $expected = join( ", ", @expected );
\r
42 # Test detach to chain of actions.
\r
43 ok( my $response = request('http://localhost/action/detach/path'), 'Request' );
\r
44 ok( $response->is_success, 'Response Successful 2xx' );
\r
45 is( $response->content_type, 'text/plain', 'Response Content-Type' );
\r
46 is( $response->header('X-Catalyst-Action'), 'action/detach/path', 'Test Action' );
\r
47 is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Detach', 'Test Class' );
\r
48 is( $response->header('X-Catalyst-Executed'), $expected, 'Executed actions' );
\r
52 ok( my $response = request('http://localhost/action/detach/with_args/old'), 'Request with args' );
\r
53 ok( $response->is_success, 'Response Successful 2xx' );
\r
54 is( $response->content, 'new');
\r
58 ok( my $response = request('http://localhost/action/detach/with_method_and_args/old'), 'Request with args and method' );
\r
59 ok( $response->is_success, 'Response Successful 2xx' );
\r
60 is( $response->content, 'new');
\r