From c1afea55a924db62f30f10dc6476444344d36953 Mon Sep 17 00:00:00 2001 From: Graham Ollis Date: Sun, 27 Jan 2013 22:14:04 -0500 Subject: [PATCH] add some tests for default templates. the second one fails, this needs to be fixed soon. --- t/default_template.t | 14 +++++++++++++- t/default_template2.t | 13 ++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/t/default_template.t b/t/default_template.t index f61b584..5babbcb 100644 --- a/t/default_template.t +++ b/t/default_template.t @@ -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... + diff --git a/t/default_template2.t b/t/default_template2.t index 879ef23..574f8c6 100644 --- a/t/default_template2.t +++ b/t/default_template2.t @@ -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...