Fixed issue with user delete ownership not migrating

Caused by input not being part of the submitted form.
Updated test to ensure the input is within a form.
For #4124
This commit is contained in:
Dan Brown 2023-03-24 14:43:48 +00:00
parent 9b66e93b15
commit 0e43618dda
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
2 changed files with 27 additions and 26 deletions

View File

@ -5,6 +5,9 @@
@include('settings.parts.navbar', ['selected' => 'users'])
<form action="{{ url("/settings/users/{$user->id}") }}" method="POST">
{!! csrf_field() !!}
<div class="card content-wrap auto-height">
<h1 class="list-heading">{{ trans('settings.users_delete') }}</h1>
@ -28,17 +31,14 @@
<div class="grid half">
<p class="text-neg"><strong>{{ trans('settings.users_delete_confirm') }}</strong></p>
<div>
<form action="{{ url("/settings/users/{$user->id}") }}" method="POST" class="text-right">
{!! csrf_field() !!}
<div class="text-right">
<input type="hidden" name="_method" value="DELETE">
<a href="{{ url("/settings/users/{$user->id}") }}" class="button outline">{{ trans('common.cancel') }}</a>
<button type="submit" class="button">{{ trans('common.confirm') }}</button>
</form>
</div>
</div>
</div>
</form>
</div>
@stop

View File

@ -145,6 +145,7 @@ class UserManagementTest extends TestCase
$resp = $this->asEditor()->get("settings/users/{$editor->id}/delete");
$resp->assertSee('Migrate Ownership');
$this->withHtml($resp)->assertElementExists('form input[name="new_owner_id"]');
$resp->assertSee('new_owner_id');
}