7 use lib "$FindBin::Bin/../../../lib";
\r
9 use Test::More tests => 180;
\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'),
\r
26 ok( $response->is_success, 'Response Successful 2xx' );
\r
27 is( $response->content_type, 'text/plain', 'Response Content-Type' );
\r
28 is( $response->header('X-Catalyst-Action'),
\r
29 'action/detach/one', 'Test Action' );
\r
31 $response->header('X-Test-Class'),
\r
32 'TestApp::Controller::Action::Detach',
\r
35 is( $response->header('X-Catalyst-Executed'),
\r
36 $expected, 'Executed actions' );
\r
41 TestApp::Controller::Action::Detach->begin
\r
42 TestApp::Controller::Action::Detach->path
\r
43 TestApp::Controller::Action::Detach->two
\r
44 TestApp::View::Dump::Request->process
\r
47 my $expected = join( ", ", @expected );
\r
49 # Test detach to chain of actions.
\r
50 ok( my $response = request('http://localhost/action/detach/path'),
\r
52 ok( $response->is_success, 'Response Successful 2xx' );
\r
53 is( $response->content_type, 'text/plain', 'Response Content-Type' );
\r
54 is( $response->header('X-Catalyst-Action'),
\r
55 'action/detach/path', 'Test Action' );
\r
57 $response->header('X-Test-Class'),
\r
58 'TestApp::Controller::Action::Detach',
\r
61 is( $response->header('X-Catalyst-Executed'),
\r
62 $expected, 'Executed actions' );
\r
68 request('http://localhost/action/detach/with_args/old'),
\r
71 ok( $response->is_success, 'Response Successful 2xx' );
\r
72 is( $response->content, 'new' );
\r
77 my $response = request(
\r
78 'http://localhost/action/detach/with_method_and_args/old'),
\r
79 'Request with args and method'
\r
81 ok( $response->is_success, 'Response Successful 2xx' );
\r
82 is( $response->content, 'new' );
\r