Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
more rendering tests
  • Loading branch information
kraih committed May 14, 2013
1 parent 35f7d77 commit 7d932b9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Changes
@@ -1,5 +1,5 @@

4.0 2013-05-14
4.0 2013-05-15
- Code name "Top Hat", this is a major release.
- Added simple JSON serialization support to Mojo::Transaction::WebSocket.
- Added json event to Mojo::Transaction::WebSocket.
Expand Down
11 changes: 11 additions & 0 deletions t/mojolicious/exception_lite_app.t
Expand Up @@ -48,6 +48,12 @@ get '/trapped' => sub {

get '/missing_template';

get '/missing_template/too' => sub {
my $self = shift;
$self->render('does_not_exist')
or $self->res->headers->header('X-Not-Found' => 1);
};

# Dummy exception object
package MyException;
use Mojo::Base -base;
Expand Down Expand Up @@ -181,6 +187,11 @@ $t->get_ok('/missing_template.json')->status_is(404)
->content_type_is('text/html;charset=UTF-8')
->content_like(qr/Page not found/);

# Missing template (failed rendering)
$t->get_ok('/missing_template/too')->status_is(404)
->header_is('X-Not-Found' => 1)->content_type_is('text/html;charset=UTF-8')
->content_like(qr/Page not found/);

# Reuse exception
ok !$exception, 'no exception';
ok !$snapshot, 'no snapshot';
Expand Down

0 comments on commit 7d932b9

Please sign in to comment.