diff --git a/README.md b/README.md index a4289f3..069dce7 100644 --- a/README.md +++ b/README.md @@ -24,8 +24,6 @@ Run the tests locally (against development environment) ## TODOs -1. Clean up that single thread view (it's late and I need sleep) -1. Tests for single thread view 1. Retrieve replies in the single thread view 1. Paging for replies in single thread view 1. Default 'threads per page' is broken if config file isn't correct diff --git a/t/thread.t b/t/thread.t new file mode 100644 index 0000000..0f17837 --- /dev/null +++ b/t/thread.t @@ -0,0 +1,14 @@ +#!/usr/bin/env perl + +use strict; +use warnings; +use Test::More; +use Mojo::File qw{curfile}; +use Test::Mojo; + +my $script = curfile->dirname->sibling('PostText.pl'); +my $t = Test::Mojo->new($script); + +$t->get_ok('/thread/1')->status_is(200)->text_like(h2 => qr/View Thread - #1/); + +done_testing(); diff --git a/templates/thread_id.html.ep b/templates/thread_id.html.ep index be4fcad..a935430 100644 --- a/templates/thread_id.html.ep +++ b/templates/thread_id.html.ep @@ -1,5 +1,5 @@ % layout 'main'; -% title 'View Threads'; +% title "View Thread - #$thread->{'id'}";

<%= title %>

<% if (my $thread = $thread) { %>