Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test script for the auto_page feature
- Loading branch information
Alexis Sukrieh
committed
Mar 7, 2010
1 parent
3206826
commit af5f9ff
Showing
2 changed files
with
28 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,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"; | ||
|
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 @@ | ||
Hello |