Tests for CAPTCHA
This commit is contained in:
parent
540dc829d2
commit
238fae2391
10
t/remark.t
10
t/remark.t
|
@ -66,9 +66,15 @@ subtest 'Flagging remark', sub {
|
|||
->element_exists('a[href*="flag"]')
|
||||
->text_like(h2 => qr/Remark #1/);
|
||||
|
||||
$t->get_ok('/remark/flag/1')->status_is(200)
|
||||
$t->get_ok('/human/remark/flag/1')->status_is(302)
|
||||
->header_like(Location => qr/captcha/);
|
||||
|
||||
# Solved CAPTCHA
|
||||
$tx->req->cookies({is_human => 1});
|
||||
|
||||
$t->get_ok('/human/thread/flag/1')->status_is(200)
|
||||
->element_exists('p[class="stash-with-info"]')
|
||||
->text_like(p => qr/Remark #1 has been flagged/);
|
||||
->text_like(p => qr/Thread #1 has been flagged/);
|
||||
};
|
||||
|
||||
done_testing;
|
||||
|
|
16
t/thread.t
16
t/thread.t
|
@ -96,7 +96,13 @@ subtest 'Bumping thread', sub {
|
|||
->element_exists('a[href*="bump"]')
|
||||
->text_like(h2 => qr/Thread #1/);
|
||||
|
||||
$t->get_ok('/thread/bump/1')->status_is(200)
|
||||
$t->get_ok('/human/thread/bump/1')->status_is(302)
|
||||
->header_like(Location => qr/captcha/);
|
||||
|
||||
# Solved CAPTCHA
|
||||
$tx->req->cookies({is_human => 1});
|
||||
|
||||
$t->get_ok('/human/thread/bump/1')->status_is(200)
|
||||
->element_exists('p[class="stash-with-info"]')
|
||||
->text_like(p => qr/Thread #1 has been bumped/);
|
||||
};
|
||||
|
@ -110,7 +116,13 @@ subtest 'Flagging thread', sub {
|
|||
->element_exists('a[href*="flag"]')
|
||||
->text_like(h2 => qr/Thread #1/);
|
||||
|
||||
$t->get_ok('/thread/flag/1')->status_is(200)
|
||||
$t->get_ok('/human/thread/flag/1')->status_is(302)
|
||||
->header_like(Location => qr/captcha/);
|
||||
|
||||
# Solved CAPTCHA
|
||||
$tx->req->cookies({is_human => 1});
|
||||
|
||||
$t->get_ok('/human/thread/flag/1')->status_is(200)
|
||||
->element_exists('p[class="stash-with-info"]')
|
||||
->text_like(p => qr/Thread #1 has been flagged/);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue