diff --git a/lib/PostText/Controller/Thread.pm b/lib/PostText/Controller/Thread.pm index e0d1fbe..43d0b02 100644 --- a/lib/PostText/Controller/Thread.pm +++ b/lib/PostText/Controller/Thread.pm @@ -62,8 +62,9 @@ sub by_id($self) { } else { $self->stash( - thread => [], - status => 404 + thread => {}, + remarks => [], + status => 404 ) } diff --git a/t/thread.t b/t/thread.t index ab538d9..6577a72 100644 --- a/t/thread.t +++ b/t/thread.t @@ -36,6 +36,9 @@ subtest 'View single thread', sub { $t->get_ok('/thread/single/1/1')->status_is(200) ->text_like(h2 => qr/Thread #1/); + + $t->get_ok('/thread/single/65536')->status_is(404) + ->text_like(h2 => qr/Thread #/); }; subtest 'Threads feed', sub {