inertiajs / inertia-laravel

The Laravel adapter for Inertia.js.
https://inertiajs.com
MIT License
2.08k stars 234 forks source link

Provide helper for asserting redirection #534

Closed deleugpn closed 5 months ago

deleugpn commented 1 year ago

Inertia uses 409 as the status code for redirection. When writing tests in Laravel with

$this->post('/', headers: ['X-Inertia' => true])->assertRedirect('/redirected');

The test will fail because Laravel relies on $this->isRedirect() to validate whether the request returned a redirect. The isRedirect() method belongs to Symfony and it doesn't consider 409 as a valid status code, which means this always fail.

driesvints commented 5 months ago

Heya. We removed our master branch. Feel free to re-attempt this to 1.x!