Fix inline rendering and test failures

This commit is contained in:
Marcus Ramberg committed 2011-01-22 17:50:08 +01:00
1 parent 26d555938f
commit 01b8f94a2b
2 files changed
+5 -4

No files matched your search

+2 -1
View File
@@ -52,11 +52,12 @@ sub _init {
return $self;
}
use Data::Dumper;
sub _render {
my ($self, $renderer, $c, $output, $options) = @_;
# Inline
my $inline = $c->{stash}->{inline};
my $inline = $options->{inline};
# Template
my $t = $renderer->template_name($options);
+3 -3
View File
@@ -34,7 +34,7 @@ get '/unknown_helper' => 'unknown_helper';
get '/on-disk' => 'foo';
get '/foo/:message' => 'index';
get '/bar/:message' => 'bar';
get '/inline' => sub { shift->render(inline => '[% 1 + 1 %]', handler => 'tt') };
@@ -44,7 +44,7 @@ my $t = Test::Mojo->new;
$t->get_ok('/exception')->status_is(500)->content_like(qr/error/i);
# Normal rendering
$t->get_ok('/foo/hello')->content_is("hello");
$t->get_ok('/bar/hello')->content_is("hello");
# With include
$t->get_ok('/with_include')->content_is("HelloInclude!Hallo");
@@ -75,7 +75,7 @@ $t->get_ok('/inline')->status_is(200)->content_is('2');
__DATA__
@@ index.html.tt
@@ bar.html.tt
[% message %]
@@ error.html.tt