2022-10-01 18:00:23 -04:00
|
|
|
use Mojo::Base -strict;
|
2022-09-03 13:08:03 -04:00
|
|
|
use Test::More;
|
|
|
|
use Test::Mojo;
|
|
|
|
|
2022-10-01 18:00:23 -04:00
|
|
|
my $t = Test::Mojo->new('PostText');
|
2022-09-03 13:08:03 -04:00
|
|
|
|
2022-10-05 22:46:15 -04:00
|
|
|
subtest 'View single remark', sub {
|
2022-10-12 23:58:46 -04:00
|
|
|
$t->get_ok('/remark/single/1')->status_is(200)
|
2023-06-25 00:01:13 -04:00
|
|
|
->text_like(h2 => qr/Remark #1/)
|
2023-06-27 20:55:41 -04:00
|
|
|
->element_exists('a[href$="/remark/post/1/1"]')
|
|
|
|
->element_exists('h2 sup a[href$=".txt"]');
|
2023-06-27 01:30:32 -04:00
|
|
|
$t->get_ok('/remark/single/65536')->status_is(404)
|
|
|
|
->text_like(p => qr/Remark not found/);
|
|
|
|
|
|
|
|
$t->get_ok('/remark/single/1.txt')->status_is(200)
|
|
|
|
->content_type_like(qr{text/plain});
|
|
|
|
$t->get_ok('/remark/single/65536.txt')->status_is(404)
|
|
|
|
->content_type_like(qr{text/plain});
|
2022-10-05 22:46:15 -04:00
|
|
|
};
|
|
|
|
|
2023-09-25 23:00:12 -04:00
|
|
|
subtest 'Remarks feed', sub {
|
|
|
|
$t->get_ok('/remark/feed.rss')->status_is(200)
|
|
|
|
->content_type_is('application/rss+xml')
|
|
|
|
};
|
|
|
|
|
2023-04-25 22:28:11 -04:00
|
|
|
done_testing;
|