add some tests for default templates.

the second one fails, this needs to be fixed soon.
This commit is contained in:
Graham Ollis
2013-01-27 22:14:04 -05:00
parent 88041ec8b0
commit c1afea55a9
2 changed files with 25 additions and 2 deletions
+13 -1
View File
@@ -1,6 +1,6 @@
use strict;
use warnings;
use Test::More tests => 3;
use Test::More tests => 6;
use Test::Mojo;
use File::Temp qw( tempdir );
@@ -25,13 +25,25 @@ get '/' => sub {
die 'foo';
};
get '/bar' => 'bar';
my $t = Test::Mojo->new;
$t->get_ok('/')
->status_is(500)
->content_like(qr{foo});
$t->get_ok('/bar')
->status_is(200)
->content_like(qr{bar});
#note $t->tx->res->to_string;
__DATA__
@@ index.html.tt
anything
@@ bar.html.tt
sometimes, the bar, he eats you...
+12 -1
View File
@@ -1,6 +1,6 @@
use strict;
use warnings;
use Test::More tests => 3;
use Test::More tests => 6;
use Test::Mojo;
use File::Temp qw( tempdir );
use FindBin '$Bin';
@@ -25,13 +25,24 @@ get '/' => sub {
die 'foo';
};
get '/bar' => 'bar';
my $t = Test::Mojo->new;
$t->get_ok('/')
->status_is(500)
->content_like(qr{foo});
$t->get_ok('/bar')
->status_is(200)
->content_like(qr{bar});
#note $t->tx->res->to_string;
__DATA__
@@ index.html.tt
anything
@@ bar.html.tt
sometimes, the bar, he eats you...