Skip to content

Commit

Permalink
Add a testcase for not screwing up ActionClass attributes.
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Ragwitz <rafl@debian.org>
  • Loading branch information
jasonk authored and rafl committed Mar 27, 2009
1 parent 6ed7aa5 commit edb5341
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
12 changes: 12 additions & 0 deletions t/action-class.t
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' );
9 changes: 9 additions & 0 deletions t/lib/Catalyst/Action/TestActionClass.pm
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;
8 changes: 8 additions & 0 deletions t/lib/TestApp/Controller/ActionClass.pm
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;

0 comments on commit edb5341

Please sign in to comment.