mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-08-07 23:03:00 +03:00
Aligned user preference endpoints in style and behaviour
Changes their endpoints and remove the user id from the URLs. Simplifies list changes to share a single endpoint, which aligns it to the behaviour of the existing sort preference endpoint. Also added test to ensure user preferences are deleted on user delete.
This commit is contained in:
@@ -160,6 +160,23 @@ class UserManagementTest extends TestCase
|
||||
]);
|
||||
}
|
||||
|
||||
public function test_delete_removes_user_preferences()
|
||||
{
|
||||
$editor = $this->getEditor();
|
||||
setting()->putUser($editor, 'dark-mode-enabled', 'true');
|
||||
|
||||
$this->assertDatabaseHas('settings', [
|
||||
'setting_key' => 'user:' . $editor->id . ':dark-mode-enabled',
|
||||
'value' => 'true',
|
||||
]);
|
||||
|
||||
$this->asAdmin()->delete("settings/users/{$editor->id}");
|
||||
|
||||
$this->assertDatabaseMissing('settings', [
|
||||
'setting_key' => 'user:' . $editor->id . ':dark-mode-enabled',
|
||||
]);
|
||||
}
|
||||
|
||||
public function test_guest_profile_shows_limited_form()
|
||||
{
|
||||
$guest = User::getDefault();
|
||||
|
Reference in New Issue
Block a user