Skip to content

Commit

Permalink
test script for the auto_page feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexis Sukrieh committed Mar 7, 2010
1 parent 3206826 commit af5f9ff
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
27 changes: 27 additions & 0 deletions t/03_route_handler/18_auto_page.t
@@ -0,0 +1,27 @@
# this test makes sure the auto_page feature works as expected
# whenever a template matches a requested path, a default route handler
# takes care of rendering it.
use strict;
use warnings;
use Test::More import => ['!pass'], tests => 10;

use lib 't';
use TestUtils;

{
package Foo;
use Dancer;

set auto_page => true;

get '/' => sub { 1 };
}

my $req = fake_request(GET => '/hello');
Dancer::SharedData->request($req);

my $resp = Dancer::Renderer::get_action_response();

ok( defined($resp), "response found for /hello");
is $resp->{content}, 'H', "content looks good";

1 change: 1 addition & 0 deletions t/03_route_handler/views/hello.tt
@@ -0,0 +1 @@
Hello

0 comments on commit af5f9ff

Please sign in to comment.