Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
better layout tests
  • Loading branch information
kraih committed Oct 28, 2013
1 parent 5896bf9 commit 17cb83c
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions t/mojolicious/layouted_lite_app.t
Expand Up @@ -69,11 +69,12 @@ get '/plain/reverse' => {text => 'Hello!', format => 'foo', reverse => 1};

get '/outerlayout' => sub {
my $self = shift;
$self->render(
template => 'outerlayout',
layout => 'layout',
handler => 'ep'
);
$self->render(template => 'outerlayout', layout => 'layout');
};

get '/outerextends' => sub {
my $self = shift;
$self->render(template => 'outerlayout', extends => 'layouts/layout');
};

get '/outerlayouttwo' => {layout => 'layout'} => sub {
Expand Down Expand Up @@ -207,6 +208,11 @@ $t->get_ok('/outerlayout')->status_is(200)
->header_is(Server => 'Mojolicious (Perl)')
->content_is("layouted Hello\n[\n 1,\n 2\n]\nthere<br>!\n\n\n");

# Extends in render call
$t->get_ok('/outerextends')->status_is(200)
->header_is(Server => 'Mojolicious (Perl)')
->content_is("layouted Hello\n[\n 1,\n 2\n]\nthere<br>!\n\n\n");

# Layout in route
$t->get_ok('/outerlayouttwo')->status_is(200)
->header_is(Server => 'Mojolicious (Perl)')
Expand Down

0 comments on commit 17cb83c

Please sign in to comment.