fix(settings): restore budgets settings redirect (#228)
## Summary - restore the legacy `/settings/budgets` route as a redirect to `/budgets` so old settings links no longer trigger a missing Inertia page - add a feature test covering the redirect to prevent the broken route from resurfacing ## Testing - php artisan test --compact tests/Feature/Settings/BudgetSettingsRedirectTest.php
This commit is contained in:
parent
a60fd6f452
commit
e5fcaee8f8
|
|
@ -47,6 +47,8 @@ Route::middleware('auth')->group(function () {
|
|||
Route::patch('settings/labels/{label}', [LabelController::class, 'update'])->name('labels.update');
|
||||
Route::delete('settings/labels/{label}', [LabelController::class, 'destroy'])->name('labels.destroy');
|
||||
|
||||
Route::redirect('settings/budgets', '/budgets')->name('budgets.settings');
|
||||
|
||||
Route::get('settings/automation-rules', [\App\Http\Controllers\Settings\AutomationRuleController::class, 'index'])->name('automation-rules.index');
|
||||
Route::post('settings/automation-rules', [\App\Http\Controllers\Settings\AutomationRuleController::class, 'store'])->name('automation-rules.store');
|
||||
Route::patch('settings/automation-rules/{automationRule}', [\App\Http\Controllers\Settings\AutomationRuleController::class, 'update'])->name('automation-rules.update');
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
use App\Models\User;
|
||||
|
||||
use function Pest\Laravel\actingAs;
|
||||
use function Pest\Laravel\get;
|
||||
|
||||
test('settings budgets route redirects to the budgets index page', function () {
|
||||
$user = User::factory()->create(['onboarded_at' => now()]);
|
||||
|
||||
actingAs($user);
|
||||
|
||||
$response = get(route('budgets.settings'));
|
||||
|
||||
$response->assertRedirect(route('budgets.index'));
|
||||
});
|
||||
Loading…
Reference in New Issue