Skip to content

Commit

Permalink
Test-case: When view is set, don't serialize
Browse files Browse the repository at this point in the history
Signed-off-by: Shea Levy <shea@shealevy.com>
  • Loading branch information
shlevy committed Mar 15, 2013
1 parent 02f66fc commit fb9d509
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions t/catalyst-action-serialize.t
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,8 @@ $res = request($t->get(url => '/serialize/empty_not_serialized_blank'));
is $res->content, '', "body explicitly set to '' results in '' content";
ok !$res->header('Content-Length'), "body explicitly set to '' - no automatic content-length";

$res = request($t->get(url => '/serialize/explicit_view'));
is $res->content, '', "view explicitly set to '' results in '' content";
ok !$res->header('Content-Length'), "view explicitly set to '' - no automatic content-length";

done_testing;
6 changes: 6 additions & 0 deletions t/lib/Test/Catalyst/Action/REST/Controller/Serialize.pm
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,10 @@ sub empty_not_serialized_blank :Chained('empty') Args(0) ActionClass('Serialize'
$c->res->body('');
}

# Explicitly set a view
sub explicit_view :Chained('empty') Args(0) ActionClass('Serialize') {
my ($self, $c) = @_;
$c->stash->{current_view} = '';
}

1;

0 comments on commit fb9d509

Please sign in to comment.