latest go/visit changes, pod fixes, all tests ok
[catagits/Catalyst-Runtime.git] / t / lib / TestApp / Controller / Action / Go.pm
CommitLineData
2f381252 1package TestApp::Controller::Action::Go;
2
3use strict;
4use base 'TestApp::Controller::Action';
5
6sub one : Local {
7 my ( $self, $c ) = @_;
8 $c->go('two');
9}
10
11sub two : Private {
12 my ( $self, $c ) = @_;
13 $c->go('three');
14}
15
16sub three : Local {
17 my ( $self, $c ) = @_;
18 $c->go( $self, 'four' );
19}
20
21sub four : Private {
22 my ( $self, $c ) = @_;
23 $c->go('/action/go/five');
24}
25
26sub five : Local {
27 my ( $self, $c ) = @_;
ae0e35ee 28 $c->forward('View::Dump::Request');
2f381252 29}
30
31sub inheritance : Local {
32 my ( $self, $c ) = @_;
33 $c->go('/action/inheritance/a/b/default');
34}
35
36sub global : Local {
37 my ( $self, $c ) = @_;
38 $c->go('/global_action');
39}
40
41sub with_args : Local {
42 my ( $self, $c, $arg ) = @_;
43 $c->go( 'args', [$arg] );
44}
45
46sub with_method_and_args : Local {
47 my ( $self, $c, $arg ) = @_;
48 $c->go( qw/TestApp::Controller::Action::Go args/, [$arg] );
49}
50
51sub args : Local {
52 my ( $self, $c, $val ) = @_;
53 die "passed argument does not match args" unless $val eq $c->req->args->[0];
54 $c->res->body($val);
55}
56
57sub go_die : Local {
58 my ( $self, $c, $val ) = @_;
59 eval { $c->go( 'args', [qq/new/] ) };
60 $c->res->body( $@ ? $@ : "go() did not die" );
61 die $Catalyst::GO;
62}
63
64sub go_chained : Local {
65 my ( $self, $c, $val ) = @_;
66 $c->go('/action/chained/foo/spoon',[1]);
67}
68
ae0e35ee 69sub view : Local {
70 my ( $self, $c, $val ) = @_;
71 eval { $c->go('View::Dump') };
72 $c->res->body( $@ ? $@ : "go() did not die" );
73}
74
75sub model : Local {
76 my ( $self, $c, $val ) = @_;
77 eval { $c->go('Model::Foo') };
78 $c->res->body( $@ ? $@ : "go() did not die" );
79}
80
2f381252 81sub args_embed_relative : Local {
82 my ( $self, $c ) = @_;
83 $c->go('embed/ok');
84}
85
86sub args_embed_absolute : Local {
87 my ( $self, $c ) = @_;
88 $c->go('/action/go/embed/ok');
89}
90
91sub embed : Local {
92 my ( $self, $c, $ok ) = @_;
93 $ok ||= 'not ok';
94 $c->res->body($ok);
95}
96
97sub class_go_test_action : Local {
98 my ( $self, $c ) = @_;
99 $c->go(qw/TestApp class_go_test_method/);
100}
101
1021;