From 69cd01361b7c9cb81e2f63a1a5f22b3e1adf31b7 Mon Sep 17 00:00:00 2001 From: swaggboi Date: Thu, 15 Aug 2024 21:09:39 -0400 Subject: [PATCH] Fix some tests to submit the CSRF token --- t/preview.t | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/t/preview.t b/t/preview.t index 737b7aa..f0574c8 100644 --- a/t/preview.t +++ b/t/preview.t @@ -23,6 +23,11 @@ my %preview_remark = ( ); # Do CAPTCHA +$t->get_ok($bump_thread_url); + +$good_captcha{'csrf_token'} = + $t->tx->res->dom->at('input[name="csrf_token"]')->val; + $t->post_ok($bump_thread_url, form => \%good_captcha) ->status_is(302) ->header_like(Location => qr{human/thread/bump/1}); @@ -36,6 +41,11 @@ subtest 'Check the form + button', sub { }; subtest 'Submit input', sub { + $t->get_ok('/human/remark/post/1'); + + $preview_remark{'csrf_token'} = + $t->tx->res->dom->at('input[name="csrf_token"]')->val; + $t->post_ok('/human/remark/post/1', form => \%preview_remark) ->status_is(200) ->text_like(p => qr/ayy\.\.\. lmao/);