opnform/tests/Feature/Forms/FormCaptchaTest.php

21 lines
595 B
PHP
Raw Normal View History

2022-09-20 19:59:52 +00:00
<?php
it('create form with captcha and raise validation issue', function () {
$user = $this->actingAsUser();
$workspace = $this->createUserWorkspace($user);
$form = $this->createForm($user, $workspace, [
'use_captcha' => true,
]);
$this->postJson(route('forms.answer', $form->slug), [])
->assertStatus(422)
->assertJson([
'message' => 'Please complete the captcha.',
'errors' => [
'h-captcha-response' => [
'Please complete the captcha.',
],
],
2024-02-23 10:54:12 +00:00
]);
2022-09-20 19:59:52 +00:00
});