Skip to content

Commit

Permalink
removed routes from list of hidden methods again and added a test
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Mar 21, 2012
1 parent 03e0c4f commit b60d44e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
3 changes: 1 addition & 2 deletions Changes
@@ -1,9 +1,8 @@
This file documents the revision history for Perl extension Mojolicious.

2.65 2012-03-21 00:00:00
2.65 2012-03-22 00:00:00
- Improved documentation.
- Improved tests.
- Fixed list of hidden attributes and methods to include routes.

2.64 2012-03-21 00:00:00
- Deprecated Mojolicious::Routes->controller_base_class in favor of
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious.pm
Expand Up @@ -73,7 +73,7 @@ sub new {
$r->hide(qw/AUTOLOAD DESTROY app cookie finish flash handler on on_finish/);
$r->hide(qw/param redirect_to render render_content render_data/);
$r->hide(qw/render_exception render_json render_not_found render_partial/);
$r->hide(qw/render_static render_text rendered req res respond_to routes/);
$r->hide(qw/render_static render_text rendered req res respond_to/);
$r->hide(qw/send session signed_cookie stash tx ua url_for write/);
$r->hide('write_chunk');

Expand Down
7 changes: 4 additions & 3 deletions t/mojolicious/app.t
Expand Up @@ -312,11 +312,12 @@ $t->get_ok('/foo/data_static')->status_is(200)
->header_is('X-Powered-By' => 'Mojolicious (Perl)')
->content_is("And this one... ALL GLORY TO THE HYPNOTOAD!\n");

# SingleFileTestApp::Foo::bar
$t->get_ok('/foo/bar')->status_is(200)
# SingleFileTestApp::Foo::routes
$t->get_ok('/foo/routes')->status_is(200)
->header_is('X-Bender' => 'Bite my shiny metal ass!')
->header_is(Server => 'Mojolicious (Perl)')
->header_is('X-Powered-By' => 'Mojolicious (Perl)')->content_is('/foo/bar');
->header_is('X-Powered-By' => 'Mojolicious (Perl)')
->content_is('/foo/routes');

$t = Test::Mojo->new('MojoliciousTest');

Expand Down
12 changes: 6 additions & 6 deletions t/mojolicious/lib/SingleFileTestApp.pm
Expand Up @@ -32,12 +32,6 @@ sub startup {
package SingleFileTestApp::Foo;
use Mojo::Base 'Mojolicious::Controller';

sub bar {
my $self = shift;
$self->res->headers->header('X-Bender' => 'Bite my shiny metal ass!');
$self->render_text($self->url_for);
}

sub data_template { shift->render('index') }

sub data_template2 { shift->stash(template => 'too') }
Expand All @@ -46,6 +40,12 @@ sub data_static { shift->render_static('singlefiletestapp/foo.txt') }

sub index { shift->stash(template => 'withlayout', msg => 'works great!') }

sub routes {
my $self = shift;
$self->res->headers->header('X-Bender' => 'Bite my shiny metal ass!');
$self->render_text($self->url_for);
}

1;
__DATA__
@@ index.html.epl
Expand Down

0 comments on commit b60d44e

Please sign in to comment.