Fix: legal-request-Honeypot nickt Bots wieder still ab

Die size:0-Regeln liefen vor dem Honeypot-Zweig: ein gefuelltes Feld
produzierte einen Validierungsfehler (verraet die Falle), der stille
done()-Pfad war tot. Honeypot-Check jetzt vor der Validierung; Test
schaerft das Soll (kein Fehler, normaler Erfolgs-Redirect).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Kevin Adametz 2026-07-03 08:14:52 +00:00
parent e90bb3c23e
commit a4ae82c3af
2 changed files with 12 additions and 10 deletions

View file

@ -99,11 +99,15 @@ test('a filled honeypot field blocks bots without creating a request', function
/** @var TestCase $this */
$release = publishedRelease();
// Soll: still und neutral abnicken — kein Validierungsfehler, der einem
// Bot die Falle verrät, sondern der normale Erfolgs-Redirect.
$this->post(route('legal-request.store', ['slug' => $release->slug]), [
'type' => LegalRequestType::Report->value,
'message' => 'Spam spam spam spam.',
$field => 'http://spam.example',
]);
])
->assertSessionHasNoErrors()
->assertRedirect(route('release.detail', ['slug' => $release->slug]));
expect(LegalRequest::query()->count())->toBe(0);
})->with(['website', 'homepage']);