Fix some tests to submit the CSRF token
This commit is contained in:
parent
2d6152d762
commit
69cd01361b
10
t/preview.t
10
t/preview.t
|
@ -23,6 +23,11 @@ my %preview_remark = (
|
||||||
);
|
);
|
||||||
|
|
||||||
# Do CAPTCHA
|
# 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)
|
$t->post_ok($bump_thread_url, form => \%good_captcha)
|
||||||
->status_is(302)
|
->status_is(302)
|
||||||
->header_like(Location => qr{human/thread/bump/1});
|
->header_like(Location => qr{human/thread/bump/1});
|
||||||
|
@ -36,6 +41,11 @@ subtest 'Check the form + button', sub {
|
||||||
};
|
};
|
||||||
|
|
||||||
subtest 'Submit input', 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)
|
$t->post_ok('/human/remark/post/1', form => \%preview_remark)
|
||||||
->status_is(200)
|
->status_is(200)
|
||||||
->text_like(p => qr/ayy\.\.\. lmao/);
|
->text_like(p => qr/ayy\.\.\. lmao/);
|
||||||
|
|
Loading…
Reference in a new issue