forked from rafl/catalyst-controller-actionrole
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a testcase for not screwing up ActionClass attributes.
Signed-off-by: Florian Ragwitz <rafl@debian.org>
- Loading branch information
Showing
3 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
use strict; | ||
use warnings; | ||
use Test::More tests => 2; | ||
|
||
use FindBin; | ||
use lib "$FindBin::Bin/lib"; | ||
|
||
use Catalyst::Test 'TestApp'; | ||
|
||
my $resp = request( "/actionclass/one" ); | ||
ok( $resp->is_success ); | ||
is( $resp->content, 'Catalyst::Action::TestActionClass' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package Catalyst::Action::TestActionClass; | ||
use parent 'Catalyst::Action'; | ||
|
||
sub execute { | ||
my ( $self, $controller, $c ) = @_; | ||
$c->response->body(__PACKAGE__); | ||
}; | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package TestApp::Controller::ActionClass; | ||
use strict; use warnings; | ||
use Moose; | ||
BEGIN { extends 'Catalyst::Controller::ActionRole'; } | ||
|
||
sub one : Local ActionClass('TestActionClass') {} | ||
|
||
1; |