Moar tests
This commit is contained in:
parent
5273bba35c
commit
0d492467a4
|
@ -24,6 +24,7 @@ Run the tests locally (against development environment)
|
||||||
|
|
||||||
## TODOs
|
## TODOs
|
||||||
|
|
||||||
|
1. Handle POST with no params (error)
|
||||||
1. Moar tests...
|
1. Moar tests...
|
||||||
1. Pick a date format
|
1. Pick a date format
|
||||||
1. **Moar tests!!**
|
1. **Moar tests!!**
|
||||||
|
|
13
t/post.t
13
t/post.t
|
@ -8,9 +8,20 @@ use Test::Mojo;
|
||||||
|
|
||||||
my $script = curfile->dirname->sibling('PostText.pl');
|
my $script = curfile->dirname->sibling('PostText.pl');
|
||||||
my $t = Test::Mojo->new($script);
|
my $t = Test::Mojo->new($script);
|
||||||
|
my %valid_params = (
|
||||||
|
name => 'Anonymous',
|
||||||
|
title => 'hi',
|
||||||
|
body => 'ayy... lmao'
|
||||||
|
);
|
||||||
|
|
||||||
$t->get_ok('/post')->status_is(200);
|
$t->ua->max_redirects(1);
|
||||||
|
|
||||||
|
$t->get_ok('/post')->status_is(200)->text_like(h2 => qr/New Thread/);;
|
||||||
|
|
||||||
|
# This should fail!! 08142022
|
||||||
$t->post_ok('/post')->status_is(200);
|
$t->post_ok('/post')->status_is(200);
|
||||||
|
|
||||||
|
$t->post_ok('/post', form => \%valid_params)->status_is(200)
|
||||||
|
->text_like(h2 => qr/View Threads/);
|
||||||
|
|
||||||
done_testing();
|
done_testing();
|
||||||
|
|
2
t/view.t
2
t/view.t
|
@ -9,6 +9,6 @@ use Test::Mojo;
|
||||||
my $script = curfile->dirname->sibling('PostText.pl');
|
my $script = curfile->dirname->sibling('PostText.pl');
|
||||||
my $t = Test::Mojo->new($script);
|
my $t = Test::Mojo->new($script);
|
||||||
|
|
||||||
$t->get_ok('/view')->status_is(200);
|
$t->get_ok('/view')->status_is(200)->text_like(h2 => qr/View Threads/);
|
||||||
|
|
||||||
done_testing();
|
done_testing();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user