Clean up the single thread view a bit and put a test in place

This commit is contained in:
swaggboi 2022-08-19 23:28:16 -04:00
parent 4c4522f7e9
commit bb48817534
3 changed files with 15 additions and 3 deletions

View File

@ -24,8 +24,6 @@ Run the tests locally (against development environment)
## TODOs ## 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. Retrieve replies in the single thread view
1. Paging for replies in single thread view 1. Paging for replies in single thread view
1. Default 'threads per page' is broken if config file isn't correct 1. Default 'threads per page' is broken if config file isn't correct

14
t/thread.t Normal file
View File

@ -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();

View File

@ -1,5 +1,5 @@
% layout 'main'; % layout 'main';
% title 'View Threads'; % title "View Thread - #$thread->{'id'}";
<h2><%= title %></h2> <h2><%= title %></h2>
<div class="threads"> <div class="threads">
<% if (my $thread = $thread) { %> <% if (my $thread = $thread) { %>