From 846eaac58df5aab02001b3f9524598cec3dc71e7 Mon Sep 17 00:00:00 2001 From: swag Date: Wed, 21 Sep 2022 00:27:16 -0400 Subject: [PATCH] Lil clean-up again --- t/post.t | 18 +++++++++--------- t/thread.t | 3 ++- templates/post.html.ep | 10 +++++----- templates/thread_id.html.ep | 4 ++-- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/t/post.t b/t/post.t index 34f90ac..3c9bf1b 100644 --- a/t/post.t +++ b/t/post.t @@ -9,27 +9,27 @@ use Test::Mojo; my $script = curfile->dirname->sibling('PostText.pl'); my $t = Test::Mojo->new($script); my %valid_params = ( - author => 'Anonymous', - title => 'hi', - body => 'ayy... lmao' + author => 'Anonymous', + title => 'hi', + body => 'ayy... lmao' ); my %invalid_title = ( author => 'Anonymous', - title => '', - body => 'ayy... lmao' + title => '', + body => 'ayy... lmao' ); my %invalid_post = ( author => 'Anonymous', - title => 'hi', - body => 'a' + title => 'hi', + body => 'a' ); my %valid_remark = ( author => 'Anonymous', - body => 'hi' + body => 'hi' ); my %invalid_remark = ( author => 'Anonymous', - body => 'a' + body => 'a' ); $t->ua->max_redirects(1); diff --git a/t/thread.t b/t/thread.t index 4527d76..d9df331 100644 --- a/t/thread.t +++ b/t/thread.t @@ -9,6 +9,7 @@ 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/Thread #1/); +$t->get_ok('/thread/1' )->status_is(200)->text_like(h2 => qr/Thread #1/); +$t->get_ok('/thread/1/1')->status_is(200)->text_like(h2 => qr/Thread #1/); done_testing(); diff --git a/templates/post.html.ep b/templates/post.html.ep index 0c48b5e..d55b45e 100644 --- a/templates/post.html.ep +++ b/templates/post.html.ep @@ -5,19 +5,19 @@
<%= label_for author => 'Author' %> <% if (my $previous_author = session->{'author'}) { =%> - <%= text_field author => $previous_author, maxlength => 63, minlength => 1 %> + <%= text_field author => $previous_author, maxlength => 63, minlength => 1 %> <% } else { =%> - <%= text_field author => 'Anonymous', maxlength => 63, minlength => 1 %> + <%= text_field author => 'Anonymous', maxlength => 63, minlength => 1 %> <% } =%> <% if (my $error = validation->error('author')) { =%> -

Invalid author: 1 to 63 characters please.

+

Invalid author: 1 to 63 characters please.

<% } =%>
<%= label_for title => 'Title' %> <%= text_field 'title', maxlength => 127, minlength => 1 %> <% if (my $error = validation->error('title')) { =%> -

Invalid title: 1 to 127 characters please.

+

Invalid title: 1 to 127 characters please.

<% } =%>
@@ -29,7 +29,7 @@ rows => 6 ) %> <% if (my $error = validation->error('body')) { =%> -

Invalid text: Up to 4,000 characters only.

+

Invalid text: Up to 4,000 characters only.

<% } =%>
<%= submit_button 'Post', class => 'post button' %> diff --git a/templates/thread_id.html.ep b/templates/thread_id.html.ep index 12939e5..24aa034 100644 --- a/templates/thread_id.html.ep +++ b/templates/thread_id.html.ep @@ -5,9 +5,9 @@
<%= label_for author => 'Author' %> <% if (my $previous_author = session->{'author'}) { =%> - <%= text_field author => $previous_author, maxlength => 63, minlength => 1 %> + <%= text_field author => $previous_author, maxlength => 63, minlength => 1 %> <% } else { =%> - <%= text_field author => 'Anonymous', maxlength => 63, minlength => 1 %> + <%= text_field author => 'Anonymous', maxlength => 63, minlength => 1 %> <% } =%> <% if (my $error = validation->error('author')) { =%>

Invalid author: 1 to 63 characters please.